Package com.attivio.sdk.search.fields
Class Cast
- java.lang.Object
-
- com.attivio.sdk.search.fields.FieldExpression
-
- com.attivio.sdk.search.fields.UnaryFieldExpression
-
- com.attivio.sdk.search.fields.Cast
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public class Cast extends UnaryFieldExpression
Apply a type cast to aFieldExpression.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.attivio.sdk.search.fields.FieldExpression
FieldExpression.StringMode
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringEXPRESSION_NAMEThe "function name" for Cast-
Fields inherited from class com.attivio.sdk.search.fields.UnaryFieldExpression
expression
-
Fields inherited from class com.attivio.sdk.search.fields.FieldExpression
EMPTY_ARRAY
-
-
Constructor Summary
Constructors Constructor Description Cast(FieldExpression expression, SchemaField.Type type)Construct a new Cast, castingexpressiontotype.Cast(FieldExpression expression, SchemaField.Type type, int scale)Construct a new Cast, castingexpressiontotype.Cast(FieldExpression expression, SchemaField.Type type, TimeResolution resolution)Construct a new Cast, castingexpressiontotype.Cast(FieldExpression expression, TimeResolution resolution)Construct a new Cast, castingexpressiontotype.Cast(java.lang.String fieldName, SchemaField.Type type)Construct a new Cast, castingfieldNametotype.Cast(java.lang.String fieldName, TimeResolution resolution)Construct a new Cast, castingfieldNametotype.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Castclone()protected Castclone(FieldExpression e)Create a new instance of this FieldExpression, with a different argument.booleanequals(java.lang.Object other)TimeResolutiongetDateResolution()Get the time resolution for date type.intgetScale()Get the scale for decimal values.SchemaField.TypegetType()Get the type to cast to.SchemaField.TypegetType(Schema schema)Resolve the type for this expression.inthashCode()voidsetDateResolution(TimeResolution value)Set the time resolution for date type.voidsetScale(int value)Set the scale for decimal values.voidsetType(SchemaField.Type type)Set the type to cast to.protected voidtoString(java.lang.StringBuilder buffer, FieldExpression.StringMode mode)Writes the string representation of this field expression tobuffer.static CastvalueOf(StringParser reader)-
Methods inherited from class com.attivio.sdk.search.fields.UnaryFieldExpression
forEachField, getExpression, getFieldName, hasChildren, isConstant, rewrite, setExpression
-
Methods inherited from class com.attivio.sdk.search.fields.FieldExpression
apply, copyOf, forEachPhrase, forEachQuery, getDefaultName, isConstant, parse, quote, rewrite, rewriteChildren, toString, toString, valueOf
-
-
-
-
Field Detail
-
EXPRESSION_NAME
public static final java.lang.String EXPRESSION_NAME
The "function name" for Cast- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Cast
public Cast(java.lang.String fieldName, SchemaField.Type type)Construct a new Cast, castingfieldNametotype.
-
Cast
public Cast(java.lang.String fieldName, TimeResolution resolution)Construct a new Cast, castingfieldNametotype.
-
Cast
public Cast(FieldExpression expression, SchemaField.Type type, int scale)
Construct a new Cast, castingexpressiontotype.
-
Cast
public Cast(FieldExpression expression, SchemaField.Type type)
Construct a new Cast, castingexpressiontotype.
-
Cast
public Cast(FieldExpression expression, TimeResolution resolution)
Construct a new Cast, castingexpressiontotype.
-
Cast
public Cast(FieldExpression expression, SchemaField.Type type, TimeResolution resolution)
Construct a new Cast, castingexpressiontotype.
-
-
Method Detail
-
getType
public SchemaField.Type getType(Schema schema)
Resolve the type for this expression.- Specified by:
getTypein classFieldExpression
-
getType
public SchemaField.Type getType()
Get the type to cast to.
-
setType
public void setType(SchemaField.Type type)
Set the type to cast to.
-
getScale
public int getScale()
Get the scale for decimal values.
-
setScale
public void setScale(int value)
Set the scale for decimal values.
-
getDateResolution
public TimeResolution getDateResolution()
Get the time resolution for date type.
-
setDateResolution
public void setDateResolution(TimeResolution value)
Set the time resolution for date type.
-
toString
protected void toString(java.lang.StringBuilder buffer, FieldExpression.StringMode mode)Writes the string representation of this field expression tobuffer.- Specified by:
toStringin classFieldExpression
-
hashCode
public int hashCode()
- Overrides:
hashCodein classUnaryFieldExpression
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classUnaryFieldExpression
-
clone
public Cast clone()
- Overrides:
clonein classUnaryFieldExpression
-
clone
protected Cast clone(FieldExpression e)
Create a new instance of this FieldExpression, with a different argument.- Overrides:
clonein classUnaryFieldExpression
-
valueOf
public static Cast valueOf(StringParser reader)
-
-