Package org.dizitart.no2.common
Class Fields
- java.lang.Object
-
- org.dizitart.no2.common.Fields
-
- All Implemented Interfaces:
Serializable
,Comparable<Fields>
- Direct Known Subclasses:
SortableFields
public class Fields extends Object implements Comparable<Fields>, Serializable
Represents a collection of document field names and provides methods for manipulating and comparing them.- Since:
- 4.0
- Author:
- Anindya Chatterjee
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Fields()
Instantiates a new Fields.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Fields
addField(String field)
Adds a field name to a list of field names and returns the updated list.int
compareTo(Fields other)
boolean
equals(Object o)
String
getEncodedName()
Gets the encoded name for thisFields
.List<String>
getFieldNames()
Gets an unmodifiable list of field names.int
hashCode()
boolean
startsWith(Fields other)
String
toString()
static Fields
withNames(String... fields)
Creates aFields
instance with field names.
-
-
-
Method Detail
-
withNames
public static Fields withNames(String... fields)
Creates aFields
instance with field names.- Parameters:
fields
- the fields- Returns:
- the fields
-
addField
public Fields addField(String field)
Adds a field name to a list of field names and returns the updated list.- Parameters:
field
- the field- Returns:
- the fields
-
getFieldNames
public List<String> getFieldNames()
Gets an unmodifiable list of field names.- Returns:
- the field names
-
startsWith
public boolean startsWith(Fields other)
- Parameters:
other
- the other- Returns:
- the boolean
-
getEncodedName
public String getEncodedName()
Gets the encoded name for thisFields
.- Returns:
- the encoded name
-
compareTo
public int compareTo(Fields other)
- Specified by:
compareTo
in interfaceComparable<Fields>
-
-