Class AbstractField<V>

java.lang.Object
studio.mevera.imperat.selector.field.AbstractField<V>
Type Parameters:
V - The type of the value that this field handles.
All Implemented Interfaces:
SelectionField<V>
Direct Known Subclasses:
NumericField, OperatorField, PredicateField, RangedNumericField

public abstract class AbstractField<V> extends Object implements SelectionField<V>
AbstractField is an abstract base class that implements the SelectionField interface. It provides a skeletal implementation of the SelectionField interface to minimize the effort required to implement this interface.
  • Field Details

    • name

      protected final String name
      The name of the selection field.
    • type

      protected final Type type
      Represents the type information of the value that this field handles. This is a wrapped type of the value that supports various operations related to type management in this field.
    • suggestions

      protected final List<String> suggestions
      A list that holds suggestion strings related to the selection field's value. This list can be used to provide autocomplete or assistive suggestions for the user.
    • ALL

      static final Set<SelectionField<?>> ALL
  • Constructor Details

    • AbstractField

      protected AbstractField(String name, studio.mevera.imperat.util.TypeWrap<V> type)
      Constructs an AbstractField instance with the specified name and type.
      Parameters:
      name - The name of the selection field.
      type - The type information of the value that this field handles, wrapped in a TypeWrap object.
  • Method Details

    • getName

      public String getName()
      Retrieves the name of the selection field.
      Specified by:
      getName in interface SelectionField<V>
      Returns:
      The name of the selection field.
    • getValueType

      public Type getValueType()
      Retrieves the type of the value handled by the selection field.
      Specified by:
      getValueType in interface SelectionField<V>
      Returns:
      The type information wrapped in a TypeWrap object, which represents the value type of the selection field.
    • getSuggestions

      public List<String> getSuggestions()
      Retrieves a list of suggestions related to this selection field's value
      Specified by:
      getSuggestions in interface SelectionField<V>
      Returns:
      A list of suggestion strings.