java.lang.Object
ch.tocco.nice2.optional.cms.impl.publicflows.mailform.SortableField
All Implemented Interfaces:
Comparable<SortableField>

public class SortableField extends Object implements Comparable<SortableField>
Represents a comparable form field which can contain a sorting number in the field name. This sorting number can either be prefixed or postfixed (separated by a underscore ('_')). Note: this class has a natural ordering that is inconsistent with equals.
  • Constructor Details

    • SortableField

      public SortableField(int sortingNr, String name, String value)
  • Method Details

    • createFromCombinedString

      public static SortableField createFromCombinedString(String fieldNameString, String value)
      Create a new instance.
      Parameters:
      fieldNameString - The field name with or without sorting number (may be prefixed or postfixed).
      value - The value of the field.
      Returns:
      a new instance.
    • getSortingNr

      public Integer getSortingNr()
    • getName

      public String getName()
    • getValue

      public String getValue()
    • compareTo

      public int compareTo(SortableField otherField)
      Specified by:
      compareTo in interface Comparable<SortableField>
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object