Package org.approvej.print
Record Class MultiLineStringPrintFormat
java.lang.Object
java.lang.Record
org.approvej.print.MultiLineStringPrintFormat
- Record Components:
printer- the printer implementing this format
- All Implemented Interfaces:
PrintFormat<Object>
@NullMarked
public record MultiLineStringPrintFormat(Printer<Object> printer)
extends Record
implements PrintFormat<Object>
A generic printer for Java
Objects that prints their properties and values one per line.-
Field Summary
Fields inherited from interface org.approvej.print.PrintFormat
DEFAULT_FILENAME_EXTENSION -
Constructor Summary
ConstructorsConstructorDescriptionMultiLineStringPrintFormat(Printer<Object> printer) Creates an instance of aMultiLineStringPrintFormatrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static MultiLineStringPrintFormatCreates a newMultiLineStringPrintFormat.printer()Returns the value of theprinterrecord component.sorted()Sort the printed object's fields alphabetically by their name.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.approvej.print.PrintFormat
filenameExtension
-
Constructor Details
-
MultiLineStringPrintFormat
Creates an instance of aMultiLineStringPrintFormatrecord class.- Parameters:
printer- the value for theprinterrecord component
-
-
Method Details
-
sorted
Sort the printed object's fields alphabetically by their name. By default, the fields will be printed in the order of their declaration.- Returns:
- a copy of this sorting fields by name
-
multiLineString
Creates a newMultiLineStringPrintFormat.- Returns:
- a new
MultiLineStringPrintFormat
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
printer
Returns the value of theprinterrecord component.- Specified by:
printerin interfacePrintFormat<Object>- Returns:
- the value of the
printerrecord component
-