Package com.attivio.sdk.search.fields
Class Switch
- java.lang.Object
-
- com.attivio.sdk.search.fields.FieldExpression
-
- com.attivio.sdk.search.fields.Switch
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public class Switch extends FieldExpression
A select case field expression.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSwitch.Case-
Nested classes/interfaces inherited from class com.attivio.sdk.search.fields.FieldExpression
FieldExpression.StringMode
-
-
Field Summary
-
Fields inherited from class com.attivio.sdk.search.fields.FieldExpression
EMPTY_ARRAY
-
-
Constructor Summary
Constructors Constructor Description Switch()Switch(FieldExpression input)Switch(FieldExpression... args)Switch(FieldExpression input, FieldExpression defaultOutput)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCase(FieldExpression condition, FieldExpression output)voidaddCase(Switch.Case value)booleanequals(java.lang.Object other)FieldExpressionforEachField(java.util.function.Function<FieldExpression,FieldExpression> handler)Applieshandlerfor eachFieldExpressionargument.java.util.List<Switch.Case>getCases()FieldExpressiongetDefaultOutput()Get theFieldExpressionthat will provide the output if no cases match.FieldExpressiongetInput()Get the inputFieldExpressionto compare against cases.SchemaField.TypegetType(Schema schema)Resolve the type for this expression.booleanhasChildren()Returnstrueif this field expression has any sub FieldExpressions.inthashCode()booleanisConstant()Returnstrueif this field expression evaluates to a constant value.voidrewrite(QueryHandler handler, boolean recursive)Rewrite any query objects in this FieldExpression usinghandler.voidsetCases(java.util.List<Switch.Case> value)voidsetDefaultOutput(FieldExpression value)Set theFieldExpressionthat will provide the output if no cases match.voidsetInput(FieldExpression value)Get the inputFieldExpressionto compare against cases.protected voidtoString(java.lang.StringBuilder buffer, FieldExpression.StringMode mode)Writes the string representation of this field expression tobuffer.static SwitchvalueOf(StringParser reader)-
Methods inherited from class com.attivio.sdk.search.fields.FieldExpression
apply, clone, copyOf, forEachPhrase, forEachQuery, getDefaultName, getFieldName, isConstant, parse, quote, rewrite, rewriteChildren, toString, toString, valueOf
-
-
-
-
Constructor Detail
-
Switch
public Switch()
-
Switch
public Switch(FieldExpression input)
-
Switch
public Switch(FieldExpression input, FieldExpression defaultOutput)
-
Switch
public Switch(FieldExpression... args)
-
-
Method Detail
-
hasChildren
public boolean hasChildren()
Returnstrueif this field expression has any sub FieldExpressions.- Specified by:
hasChildrenin classFieldExpression
-
isConstant
public boolean isConstant()
Returnstrueif this field expression evaluates to a constant value.- Specified by:
isConstantin classFieldExpression
-
getType
public SchemaField.Type getType(Schema schema)
Resolve the type for this expression.- Specified by:
getTypein classFieldExpression
-
getInput
public FieldExpression getInput()
Get the inputFieldExpressionto compare against cases.
-
setInput
public void setInput(FieldExpression value)
Get the inputFieldExpressionto compare against cases.
-
getCases
public java.util.List<Switch.Case> getCases()
-
setCases
public void setCases(java.util.List<Switch.Case> value)
-
addCase
public void addCase(FieldExpression condition, FieldExpression output)
-
addCase
public void addCase(Switch.Case value)
-
getDefaultOutput
public FieldExpression getDefaultOutput()
Get theFieldExpressionthat will provide the output if no cases match.
-
setDefaultOutput
public void setDefaultOutput(FieldExpression value)
Set theFieldExpressionthat will provide the output if no cases match.
-
rewrite
public void rewrite(QueryHandler handler, boolean recursive)
Rewrite any query objects in this FieldExpression usinghandler.- Overrides:
rewritein classFieldExpression
-
forEachField
public FieldExpression forEachField(java.util.function.Function<FieldExpression,FieldExpression> handler)
- Overrides:
forEachFieldin classFieldExpression
-
hashCode
public int hashCode()
Description copied from class:FieldExpression- Overrides:
hashCodein classFieldExpression
-
equals
public final boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
toString
protected void toString(java.lang.StringBuilder buffer, FieldExpression.StringMode mode)Writes the string representation of this field expression tobuffer.- Specified by:
toStringin classFieldExpression
-
valueOf
public static Switch valueOf(StringParser reader)
-
-