Class FieldDescription

  • All Implemented Interfaces:
    java.lang.Comparable<FieldDescription>

    public class FieldDescription
    extends java.lang.Object
    implements java.lang.Comparable<FieldDescription>
    A field description of a query profile type. Immutable. Field descriptions can be sorted by name.
    Author:
    bratseth
    • Constructor Summary

      Constructors 
      Constructor Description
      FieldDescription​(com.yahoo.processing.request.CompoundName name, FieldType type, java.lang.String aliases, boolean mandatory, boolean overridable)
      Creates a field description from a list where the aliases are represented as a comma-separated string
      FieldDescription​(com.yahoo.processing.request.CompoundName name, FieldType type, java.util.List<java.lang.String> aliases, boolean mandatory, boolean overridable)
      Creates a field description
      FieldDescription​(java.lang.String name, FieldType type)  
      FieldDescription​(java.lang.String name, FieldType type, boolean mandatory)  
      FieldDescription​(java.lang.String name, FieldType type, boolean mandatory, boolean overridable)  
      FieldDescription​(java.lang.String name, FieldType type, java.lang.String aliases)  
      FieldDescription​(java.lang.String name, FieldType type, java.lang.String aliases, boolean mandatory, boolean overridable)  
      FieldDescription​(java.lang.String name, java.lang.String type)  
      FieldDescription​(java.lang.String name, java.lang.String type, java.lang.String aliases)  
      FieldDescription​(java.lang.String name, java.lang.String typeString, java.lang.String aliases, boolean mandatory, boolean overridable)
      Creates a field description
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(FieldDescription other)  
      java.util.List<java.lang.String> getAliases()
      Returns a unmodifiable list of the aliases of this.
      com.yahoo.processing.request.CompoundName getCompoundName()
      Returns the full name of this as a compound name
      java.lang.String getName()
      Returns the full name of this as a string
      FieldType getType()  
      boolean isMandatory()
      Returns whether this field must be provided in the query profile or the search definition.
      boolean isOverridable()
      Returns false if overrides to values for this field from the outside should be ignored.
      java.lang.String toString()  
      FieldDescription withName​(com.yahoo.processing.request.CompoundName name)
      Returns a copy of this with the name set to the argument name
      FieldDescription withType​(FieldType type)
      Returns a copy of this with the type set to the argument type
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • FieldDescription

        public FieldDescription​(java.lang.String name,
                                FieldType type)
      • FieldDescription

        public FieldDescription​(java.lang.String name,
                                java.lang.String type)
      • FieldDescription

        public FieldDescription​(java.lang.String name,
                                FieldType type,
                                boolean mandatory)
      • FieldDescription

        public FieldDescription​(java.lang.String name,
                                java.lang.String type,
                                java.lang.String aliases)
      • FieldDescription

        public FieldDescription​(java.lang.String name,
                                FieldType type,
                                java.lang.String aliases)
      • FieldDescription

        public FieldDescription​(java.lang.String name,
                                java.lang.String typeString,
                                java.lang.String aliases,
                                boolean mandatory,
                                boolean overridable)
        Creates a field description
        Parameters:
        name - the name of the field
        typeString - the type of the field represented as a string - see FieldType
        aliases - a space-separated list of alias names of this field name. Aliases are not following dotted (meaning they are global, not that they cannot contain dots) and are case insensitive. Null is permissible if there are no aliases
        mandatory - whether it is mandatory to provide a value for this field. default: false
        overridable - whether this can be overridden when first set in a profile. Default: true
      • FieldDescription

        public FieldDescription​(java.lang.String name,
                                FieldType type,
                                boolean mandatory,
                                boolean overridable)
      • FieldDescription

        public FieldDescription​(java.lang.String name,
                                FieldType type,
                                java.lang.String aliases,
                                boolean mandatory,
                                boolean overridable)
      • FieldDescription

        public FieldDescription​(com.yahoo.processing.request.CompoundName name,
                                FieldType type,
                                java.lang.String aliases,
                                boolean mandatory,
                                boolean overridable)
        Creates a field description from a list where the aliases are represented as a comma-separated string
      • FieldDescription

        public FieldDescription​(com.yahoo.processing.request.CompoundName name,
                                FieldType type,
                                java.util.List<java.lang.String> aliases,
                                boolean mandatory,
                                boolean overridable)
        Creates a field description
        Parameters:
        name - the name of the field
        type - the type of the field represented as a string - see FieldType
        aliases - a list of aliases, never null. Aliases are not following dotted (meaning they are global, not that they cannot contain dots) and are case insensitive.
        mandatory - whether it is mandatory to provide a value for this field. default: false
        overridable - whether this can be overridden when first set in a profile. Default: true
    • Method Detail

      • getName

        public java.lang.String getName()
        Returns the full name of this as a string
      • getCompoundName

        public com.yahoo.processing.request.CompoundName getCompoundName()
        Returns the full name of this as a compound name
      • getAliases

        public java.util.List<java.lang.String> getAliases()
        Returns a unmodifiable list of the aliases of this. An empty list (never null) if there are none.
      • isMandatory

        public boolean isMandatory()
        Returns whether this field must be provided in the query profile or the search definition. Default: false
      • isOverridable

        public boolean isOverridable()
        Returns false if overrides to values for this field from the outside should be ignored. Default: true
      • withName

        public FieldDescription withName​(com.yahoo.processing.request.CompoundName name)
        Returns a copy of this with the name set to the argument name
      • withType

        public FieldDescription withType​(FieldType type)
        Returns a copy of this with the type set to the argument type
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object