public abstract class FieldType extends Object
Modifier and Type | Field and Description |
---|---|
static PrimitiveFieldType |
booleanType |
static PrimitiveFieldType |
doubleType |
static PrimitiveFieldType |
floatType |
static QueryProfileFieldType |
genericQueryProfileType |
static PrimitiveFieldType |
integerType |
static PrimitiveFieldType |
longType |
static QueryFieldType |
queryType |
static PrimitiveFieldType |
stringType |
Constructor and Description |
---|
FieldType() |
Modifier and Type | Method and Description |
---|---|
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
|
abstract Object |
convertFrom(Object o,
CompiledQueryProfileRegistry registry)
Converts the given type to an instance of this type, if possible.
|
abstract Object |
convertFrom(Object o,
QueryProfileRegistry registry)
Converts the given type to an instance of this type, if possible.
|
static FieldType |
fromString(String typeString,
QueryProfileTypeRegistry registry)
Returns the field type for a given string name.
|
abstract Class |
getValueClass()
Returns the class of instance values of this field type
|
static boolean |
isLegalFieldValue(Object value)
Returns true if the given object is a legal field value of some field value type
|
abstract String |
stringValue()
Returns a string representation of this type which can be converted back to a type class by
fromString(java.lang.String, com.yahoo.search.query.profile.types.QueryProfileTypeRegistry) |
abstract String |
toInstanceDescription()
Returns a string describing possible instances of this type, suitable for user error messages
|
abstract String |
toString() |
public static final PrimitiveFieldType stringType
public static final PrimitiveFieldType integerType
public static final PrimitiveFieldType longType
public static final PrimitiveFieldType floatType
public static final PrimitiveFieldType doubleType
public static final PrimitiveFieldType booleanType
public static final QueryFieldType queryType
public static final QueryProfileFieldType genericQueryProfileType
public abstract Class getValueClass()
public abstract String stringValue()
fromString(java.lang.String, com.yahoo.search.query.profile.types.QueryProfileTypeRegistry)
public abstract String toInstanceDescription()
public abstract Object convertFrom(Object o, QueryProfileRegistry registry)
public abstract Object convertFrom(Object o, CompiledQueryProfileRegistry registry)
public com.yahoo.tensor.TensorType asTensorType()
public static FieldType fromString(String typeString, QueryProfileTypeRegistry registry)
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 usedIllegalArgumentException
- if the string does not resolve to a typepublic static boolean isLegalFieldValue(Object value)
Copyright © 2018. All rights reserved.