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 Summary
Modifier and TypeMethodDescriptionint
boolean
getName()
Returns the name of this object.Returns the normalized name of this field, which is safe to use in case-insensitive operations.getNormalizedValue
(String value) Returns the normalized value, which is safe to use in case-insensitive operations.getNormalizedValue
(Reference reference) Returns the normalized value, which is safe to use in case-insensitive operations.getType()
Returns the type of this field.int
hashCode()
boolean
Returnstrue
if this field matches the given name;false
otherwise.static FieldBuilder
Constructs a field builder with the given name.toString()
-
Method Details
-
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:- Prefer using alphanumeric characters including
'_'
and'-'
. - Avoid whitespace and other control characters.
null
can be returned, if allowed by the implementation, to indicate the object is anonymous or has no assigned name.
- Prefer using alphanumeric characters including
-
getNormalizedName
Returns the normalized name of this field, which is safe to use in case-insensitive operations.- Returns:
- the normalized name
-
getType
Returns the type of this field.- Returns:
- the type
-
getNormalizedValue
Returns the normalized value, which is safe to use in case-insensitive operations.- Parameters:
value
- the original value- Returns:
- the normalized value
-
getNormalizedValue
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
-
hashCode
public int hashCode() -
equals
-
compareTo
- Specified by:
compareTo
in interfaceComparable<T extends Comparable<? super T>>
-
matches
Returnstrue
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
Constructs a field builder with the given name.- Parameters:
name
- the field name- Returns:
- the field builder for configuring this field
-