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:
  • Constructor Details

    • Fields

      public Fields()
      Instantiates a new Fields.
  • Method Details

    • withNames

      public static Fields withNames(String... fields)
      Creates a Fields 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)
      Check if a Fields is a subset of the current Fields.
      Parameters:
      other - the other
      Returns:
      the boolean
    • getEncodedName

      public String getEncodedName()
      Gets the encoded name for this Fields.
      Returns:
      the encoded name
    • toString

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

      public int compareTo(Fields other)
      Specified by:
      compareTo in interface Comparable<Fields>
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object