Class PrimitiveFieldType
- java.lang.Object
-
- com.yahoo.search.query.profile.types.FieldType
-
- com.yahoo.search.query.profile.types.PrimitiveFieldType
-
public class PrimitiveFieldType extends FieldType
Represents a query field type which is a primitive - String, Integer, Float, Double or Long.- Author:
- bratseth
-
-
Field Summary
-
Fields inherited from class com.yahoo.search.query.profile.types.FieldType
booleanType, doubleType, floatType, genericQueryProfileType, integerType, longType, queryType, stringType
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
convertFrom(Object object, QueryProfileRegistry registry)
Converts the given type to an instance of this type, if possible.Object
convertFrom(Object object, ConversionContext context)
Converts the given type to an instance of this type, if possible.boolean
equals(Object o)
Class
getValueClass()
Returns the class of instance values of this field typeint
hashCode()
String
stringValue()
Returns a string representation of this type which can be converted back to a type class byFieldType.fromString(java.lang.String, com.yahoo.search.query.profile.types.QueryProfileTypeRegistry)
String
toInstanceDescription()
Returns a string describing possible instances of this type, suitable for user error messagesString
toString()
-
Methods inherited from class com.yahoo.search.query.profile.types.FieldType
asTensorType, fromString, isLegalFieldValue
-
-
-
-
Method Detail
-
getValueClass
public Class getValueClass()
Description copied from class:FieldType
Returns the class of instance values of this field type- Specified by:
getValueClass
in classFieldType
-
stringValue
public String stringValue()
Description copied from class:FieldType
Returns a string representation of this type which can be converted back to a type class byFieldType.fromString(java.lang.String, com.yahoo.search.query.profile.types.QueryProfileTypeRegistry)
- Specified by:
stringValue
in classFieldType
-
toInstanceDescription
public String toInstanceDescription()
Description copied from class:FieldType
Returns a string describing possible instances of this type, suitable for user error messages- Specified by:
toInstanceDescription
in classFieldType
-
convertFrom
public Object convertFrom(Object object, ConversionContext context)
Description copied from class:FieldType
Converts the given type to an instance of this type, if possible. Returns null if not possible.- Specified by:
convertFrom
in classFieldType
-
convertFrom
public Object convertFrom(Object object, QueryProfileRegistry registry)
Description copied from class:FieldType
Converts the given type to an instance of this type, if possible. Returns null if not possible.- Specified by:
convertFrom
in classFieldType
-
-