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:
Provider<PrintFormat<Object>>,PrintFormat<Object>,PrintFormatProvider<Object>
@NullMarked
public record MultiLineStringPrintFormat(Printer<Object> printer)
extends Record
implements PrintFormat<Object>, PrintFormatProvider<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
ConstructorsConstructorDescriptionDefault constructor using aMultiLineStringPrintFormat.MultiLineStringPrinterwith no sorting.MultiLineStringPrintFormat(Printer<Object> printer) Creates an instance of aMultiLineStringPrintFormatrecord class. -
Method Summary
Modifier and TypeMethodDescriptionalias()Returns the alias that can be used to reference this provider in configuration.create()Creates a new instance of the component.final 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 properties 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
filenameExtensionMethods inherited from interface org.approvej.print.PrintFormatProvider
type
-
Constructor Details
-
MultiLineStringPrintFormat
public MultiLineStringPrintFormat()Default constructor using aMultiLineStringPrintFormat.MultiLineStringPrinterwith no sorting. -
MultiLineStringPrintFormat
Creates an instance of aMultiLineStringPrintFormatrecord class.- Parameters:
printer- the value for theprinterrecord component
-
-
Method Details
-
sorted
Sort the printed object's properties alphabetically by their name. By default, field-backed properties are printed in declaration order, followed by getter-only properties alphabetically.- Returns:
- a copy of this sorting all properties by name
-
alias
Description copied from interface:ProviderReturns the alias that can be used to reference this provider in configuration.For example, "json" or "yaml" for print formats, or "none" or "automatic" for reviewers.
- Specified by:
aliasin interfaceProvider<PrintFormat<Object>>- Returns:
- the alias for this provider
-
create
Description copied from interface:ProviderCreates a new instance of the component.When implemented by the component class itself, this typically returns a new instance of the same class via its no-argument constructor.
- Specified by:
createin interfaceProvider<PrintFormat<Object>>- Returns:
- a new instance of the component
-
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
-