Class FieldDescription
- java.lang.Object
-
- com.yahoo.search.query.profile.types.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 stringFieldDescription(com.yahoo.processing.request.CompoundName name, FieldType type, java.util.List<java.lang.String> aliases, boolean mandatory, boolean overridable)
Creates a field descriptionFieldDescription(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 namejava.lang.String
getName()
Returns the full name of this as a stringFieldType
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 nameFieldDescription
withType(FieldType type)
Returns a copy of this with the type set to the argument type
-
-
-
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 fieldtypeString
- the type of the field represented as a string - seeFieldType
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 aliasesmandatory
- whether it is mandatory to provide a value for this field. default: falseoverridable
- 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 fieldtype
- the type of the field represented as a string - seeFieldType
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: falseoverridable
- 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
-
getType
public FieldType getType()
-
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
-
compareTo
public int compareTo(FieldDescription other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<FieldDescription>
-
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 classjava.lang.Object
-
-