Record Class FormatterConfiguration

java.lang.Object
java.lang.Record
org.csvobjects.csv.formatters.FormatterConfiguration
Record Components:
formatterName - the declarative name of the formatter
formatterClass - the fully qualified class name of the formatter
constructionNeeded - 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 Details

    • FormatterConfiguration

      public FormatterConfiguration(String formatterName, String formatterClass, boolean constructionNeeded)
      Creates an instance of a FormatterConfiguration record class.
      Parameters:
      formatterName - the value for the formatterName record component
      formatterClass - the value for the formatterClass record component
      constructionNeeded - the value for the constructionNeeded record component
  • Method Details

    • compareTo

      public int compareTo(FormatterConfiguration other)
      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:
      compareTo in interface Comparable<FormatterConfiguration>
      Parameters:
      other - the other configuration to compare against
      Returns:
      0 if the two configurations are equal, -1 if this configuration ranks "lower", +1 if this configuration ranks "higher"
      See Also:
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • formatterName

      public String formatterName()
      Returns the value of the formatterName record component.
      Returns:
      the value of the formatterName record component
    • formatterClass

      public String formatterClass()
      Returns the value of the formatterClass record component.
      Returns:
      the value of the formatterClass record component
    • constructionNeeded

      public boolean constructionNeeded()
      Returns the value of the constructionNeeded record component.
      Returns:
      the value of the constructionNeeded record component