Package org.csvobjects.csv.formatters
Record Class FormatterConfiguration
java.lang.Object
java.lang.Record
org.csvobjects.csv.formatters.FormatterConfiguration
- Record Components:
formatterName- the declarative name of the formatterformatterClass- the fully qualified class name of the formatterconstructionNeeded- whether special (non-cached) construction is needed by the factory for this formatter
- All Implemented Interfaces:
Comparable<FormatterConfiguration>
public record FormatterConfiguration(String formatterName, String formatterClass, boolean constructionNeeded)
extends Record
implements Comparable<FormatterConfiguration>
Immutable configuration for a single declaratively named CSV field
formatter.
- Since:
- 1.8
- Author:
- Anupam Sengupta
-
Constructor Summary
ConstructorsConstructorDescriptionFormatterConfiguration(String formatterName, String formatterClass, boolean constructionNeeded) Creates an instance of aFormatterConfigurationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(FormatterConfiguration other) Compares this formatter configuration to another configuration for ordering purposes.booleanReturns the value of theconstructionNeededrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theformatterClassrecord component.Returns the value of theformatterNamerecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
FormatterConfiguration
public FormatterConfiguration(String formatterName, String formatterClass, boolean constructionNeeded) Creates an instance of aFormatterConfigurationrecord class.- Parameters:
formatterName- the value for theformatterNamerecord componentformatterClass- the value for theformatterClassrecord componentconstructionNeeded- the value for theconstructionNeededrecord component
-
-
Method Details
-
compareTo
Compares this formatter configuration to another configuration for ordering purposes. The comparison is based on the formatter name, and then the formatter class.- Specified by:
compareToin interfaceComparable<FormatterConfiguration>- Parameters:
other- the other configuration to compare against- Returns:
0if the two configurations are equal,-1if this configuration ranks "lower",+1if this configuration ranks "higher"- See Also:
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
formatterName
Returns the value of theformatterNamerecord component.- Returns:
- the value of the
formatterNamerecord component
-
formatterClass
Returns the value of theformatterClassrecord component.- Returns:
- the value of the
formatterClassrecord component
-
constructionNeeded
public boolean constructionNeeded()Returns the value of theconstructionNeededrecord component.- Returns:
- the value of the
constructionNeededrecord component
-