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.String
EXPRESSION_NAME
The "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, castingexpression
totype
.Cast(FieldExpression expression, SchemaField.Type type, int scale)
Construct a new Cast, castingexpression
totype
.Cast(FieldExpression expression, SchemaField.Type type, TimeResolution resolution)
Construct a new Cast, castingexpression
totype
.Cast(FieldExpression expression, TimeResolution resolution)
Construct a new Cast, castingexpression
totype
.Cast(java.lang.String fieldName, SchemaField.Type type)
Construct a new Cast, castingfieldName
totype
.Cast(java.lang.String fieldName, TimeResolution resolution)
Construct a new Cast, castingfieldName
totype
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Cast
clone()
protected Cast
clone(FieldExpression e)
Create a new instance of this FieldExpression, with a different argument.boolean
equals(java.lang.Object other)
TimeResolution
getDateResolution()
Get the time resolution for date type.int
getScale()
Get the scale for decimal values.SchemaField.Type
getType()
Get the type to cast to.SchemaField.Type
getType(Schema schema)
Resolve the type for this expression.int
hashCode()
void
setDateResolution(TimeResolution value)
Set the time resolution for date type.void
setScale(int value)
Set the scale for decimal values.void
setType(SchemaField.Type type)
Set the type to cast to.protected void
toString(java.lang.StringBuilder buffer, FieldExpression.StringMode mode)
Writes the string representation of this field expression tobuffer
.static Cast
valueOf(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, castingfieldName
totype
.
-
Cast
public Cast(java.lang.String fieldName, TimeResolution resolution)
Construct a new Cast, castingfieldName
totype
.
-
Cast
public Cast(FieldExpression expression, SchemaField.Type type, int scale)
Construct a new Cast, castingexpression
totype
.
-
Cast
public Cast(FieldExpression expression, SchemaField.Type type)
Construct a new Cast, castingexpression
totype
.
-
Cast
public Cast(FieldExpression expression, TimeResolution resolution)
Construct a new Cast, castingexpression
totype
.
-
Cast
public Cast(FieldExpression expression, SchemaField.Type type, TimeResolution resolution)
Construct a new Cast, castingexpression
totype
.
-
-
Method Detail
-
getType
public SchemaField.Type getType(Schema schema)
Resolve the type for this expression.- Specified by:
getType
in 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:
toString
in classFieldExpression
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classUnaryFieldExpression
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classUnaryFieldExpression
-
clone
public Cast clone()
- Overrides:
clone
in classUnaryFieldExpression
-
clone
protected Cast clone(FieldExpression e)
Create a new instance of this FieldExpression, with a different argument.- Overrides:
clone
in classUnaryFieldExpression
-
valueOf
public static Cast valueOf(StringParser reader)
-
-