Class FieldType
java.lang.Object
com.yahoo.search.query.profile.types.FieldType
- Direct Known Subclasses:
PrimitiveFieldType,QueryFieldType,QueryProfileFieldType,TensorFieldType
Superclass of query type field types.
Field types are immutable.
- Author:
- bratseth
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PrimitiveFieldTypestatic final PrimitiveFieldTypestatic final PrimitiveFieldTypestatic final QueryProfileFieldTypestatic final PrimitiveFieldTypestatic final PrimitiveFieldTypestatic final QueryFieldTypestatic final PrimitiveFieldType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.yahoo.tensor.TensorTypeReturns this type as a tensor type: The true tensor type is this is a tensor field an an empty type - interpreted as a double in numerical contexts - otherwiseabstract ObjectconvertFrom(Object o, QueryProfileRegistry registry) Converts the given type to an instance of this type, if possible.abstract ObjectconvertFrom(Object o, ConversionContext context) Converts the given type to an instance of this type, if possible.static FieldTypefromString(String typeString, QueryProfileTypeRegistry registry) Returns the field type for a given string name.abstract ClassReturns the class of instance values of this field typestatic booleanisLegalFieldValue(Object value) Returns true if the given object is a legal field value of some field value typeabstract StringReturns a string representation of this type which can be converted back to a type class byfromString(java.lang.String, com.yahoo.search.query.profile.types.QueryProfileTypeRegistry)abstract StringReturns a string describing possible instances of this type, suitable for user error messagesabstract StringtoString()
-
Field Details
-
stringType
-
integerType
-
longType
-
floatType
-
doubleType
-
booleanType
-
queryType
-
genericQueryProfileType
-
-
Constructor Details
-
FieldType
public FieldType()
-
-
Method Details
-
getValueClass
Returns the class of instance values of this field type -
stringValue
Returns a string representation of this type which can be converted back to a type class byfromString(java.lang.String, com.yahoo.search.query.profile.types.QueryProfileTypeRegistry) -
toString
-
toInstanceDescription
Returns a string describing possible instances of this type, suitable for user error messages -
convertFrom
Converts the given type to an instance of this type, if possible. Returns null if not possible. -
convertFrom
Converts the given type to an instance of this type, if possible. Returns null if not possible. -
asTensorType
public com.yahoo.tensor.TensorType asTensorType()Returns this type as a tensor type: The true tensor type is this is a tensor field an an empty type - interpreted as a double in numerical contexts - otherwise -
fromString
Returns the field type for a given string name.- Parameters:
typeString- a type string - a primitive name, "query-profile" or "query-profile:profile-name"registry- the registry in which query profile references are resolved when the last form above is used, or null in which case that form cannot be used- Throws:
IllegalArgumentException- if the string does not resolve to a type
-
isLegalFieldValue
Returns true if the given object is a legal field value of some field value type
-