Class Field<T extends Comparable<? super T>>

java.lang.Object
org.moeaframework.analysis.store.schema.Field<T>
Type Parameters:
T - the type of this field
All Implemented Interfaces:
Comparable<Field<T>>, Named

public class Field<T extends Comparable<? super T>> extends Object implements Comparable<Field<T>>, Named
A field defined in a schema. Fields are case-insensitive and provide methods for ordering and matching fields in a case-insensitive manner.
  • Method Details

    • getName

      public String getName()
      Description copied from interface: Named
      Returns the name of this object. The format for the name depends on the specific implementation, but in general we recommend:
      1. Prefer using alphanumeric characters including '_' and '-'.
      2. Avoid whitespace and other control characters.
      3. null can be returned, if allowed by the implementation, to indicate the object is anonymous or has no assigned name.
      Specified by:
      getName in interface Named
      Returns:
      the name
    • getNormalizedName

      public String getNormalizedName()
      Returns the normalized name of this field, which is safe to use in case-insensitive operations.
      Returns:
      the normalized name
    • getType

      public Class<T> getType()
      Returns the type of this field.
      Returns:
      the type
    • getNormalizedValue

      public String getNormalizedValue(String value)
      Returns the normalized value, which is safe to use in case-insensitive operations.
      Parameters:
      value - the original value
      Returns:
      the normalized value
    • getNormalizedValue

      public String getNormalizedValue(Reference reference)
      Returns the normalized value, which is safe to use in case-insensitive operations.
      Parameters:
      reference - the reference from which the value is read
      Returns:
      the normalized value
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • compareTo

      public int compareTo(Field<T> rhs)
      Specified by:
      compareTo in interface Comparable<T extends Comparable<? super T>>
    • matches

      public boolean matches(String name)
      Returns true if this field matches the given name; false otherwise.
      Parameters:
      name - the name
      Returns:
      true if this field matches the given name; false otherwise
    • named

      public static FieldBuilder named(String name)
      Constructs a field builder with the given name.
      Parameters:
      name - the field name
      Returns:
      the field builder for configuring this field