Class FieldDescriptor<T>

    • Field Detail

      • sortFunction

        protected transient Function<?,​T> sortFunction
      • sort

        protected boolean sort
    • Constructor Detail

      • FieldDescriptor

        protected FieldDescriptor​(String fieldName,
                                  Class<T> type)
    • Method Detail

      • checkFieldType

        public static boolean checkFieldType​(Class<?> type)
        Checks if a class is a valid field content type.
        Parameters:
        type - Class to be checked.
        Returns:
        True if it is a valid content, false otherwise.
      • getName

        public String getName()
        Gets the field Name.
        Returns:
        Field name.
      • setName

        protected void setName​(String name)
      • getType

        public Class<T> getType()
        Gets the field type of content.
        Returns:
        Field type.
      • setStored

        protected void setStored​(boolean stored)
      • isStored

        public boolean isStored()
        Checks if a field is stored or not.
        Returns:
        True if it is configured to be stored.
      • setIndexed

        protected void setIndexed​(boolean indexed)
      • isIndexed

        public boolean isIndexed()
        Checks if a field is indexed or not.
        Returns:
        True if it is configured to be indexed.
      • setFullText

        protected void setFullText​(boolean fullText)
      • isFullText

        public boolean isFullText()
        Checks if a field is fullText searchable or not.
        Returns:
        True if it is configured to be fullText searchable.
      • setLanguage

        protected void setLanguage​(Language language)
      • getLanguage

        public Language getLanguage()
        Gets the field language configured.
        Returns:
        Field Language
      • setBoost

        protected void setBoost​(float boost)
      • getBoost

        public float getBoost()
        Gets the field configured boosting value.
        Returns:
        Field boost.
      • setFacet

        protected void setFacet​(boolean facet)
      • isFacet

        public boolean isFacet()
        Checks if a field is use for faceting or not.
        Returns:
        True if it is configured to be use for facets.
      • setSuggest

        protected void setSuggest​(boolean suggest)
      • isSuggest

        public boolean isSuggest()
        Checks if a field is use for suggesting or not.
        Returns:
        True if it is configured to be use for suggestion.
      • isMultiValue

        public boolean isMultiValue()
        Checks if a field is multivalued or not.
        Returns:
        True if it is configured to be multivalued.
      • setMultiValue

        protected void setMultiValue​(boolean multiValue)
      • getMetadata

        public Map<String,​String> getMetadata()
        Gets the field configured metadata.
        Returns:
        Field metadata
      • setMetadata

        protected void setMetadata​(Map<String,​String> metadata)
      • isSort

        public boolean isSort()
      • isUpdate

        public boolean isUpdate()
      • setUpdate

        protected void setUpdate​(boolean update)
      • isContextualized

        public boolean isContextualized()
      • setContextualized

        public void setContextualized​(boolean contextualized)
      • isNotEmpty

        public Filter isNotEmpty()
        Instantiates a new Filter to checking if a field value is not empty.
        Returns:
        A configured filter for the field.
      • isEmpty

        public Filter isEmpty()
        Instantiates a new Filter to checking if a field value is empty.
        Returns:
        A configured filter for the field.
      • hasUseCase

        public boolean hasUseCase​(FieldDescriptor.UseCase useCase)
        Cheks if a the field descriptor has the given usecase defined.
        Parameters:
        useCase - FieldDescriptor.UseCase to check if the field is configured to support.
        Returns:
        returns true if the field is configured to work with the provided usecase, false otherwise.