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 class
Switch.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 void
addCase(FieldExpression condition, FieldExpression output)
void
addCase(Switch.Case value)
boolean
equals(java.lang.Object other)
FieldExpression
forEachField(java.util.function.Function<FieldExpression,FieldExpression> handler)
Applieshandler
for eachFieldExpression
argument.java.util.List<Switch.Case>
getCases()
FieldExpression
getDefaultOutput()
Get theFieldExpression
that will provide the output if no cases match.FieldExpression
getInput()
Get the inputFieldExpression
to compare against cases.SchemaField.Type
getType(Schema schema)
Resolve the type for this expression.boolean
hasChildren()
Returnstrue
if this field expression has any sub FieldExpressions.int
hashCode()
boolean
isConstant()
Returnstrue
if this field expression evaluates to a constant value.void
rewrite(QueryHandler handler, boolean recursive)
Rewrite any query objects in this FieldExpression usinghandler
.void
setCases(java.util.List<Switch.Case> value)
void
setDefaultOutput(FieldExpression value)
Set theFieldExpression
that will provide the output if no cases match.void
setInput(FieldExpression value)
Get the inputFieldExpression
to compare against cases.protected void
toString(java.lang.StringBuilder buffer, FieldExpression.StringMode mode)
Writes the string representation of this field expression tobuffer
.static Switch
valueOf(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()
Returnstrue
if this field expression has any sub FieldExpressions.- Specified by:
hasChildren
in classFieldExpression
-
isConstant
public boolean isConstant()
Returnstrue
if this field expression evaluates to a constant value.- Specified by:
isConstant
in classFieldExpression
-
getType
public SchemaField.Type getType(Schema schema)
Resolve the type for this expression.- Specified by:
getType
in classFieldExpression
-
getInput
public FieldExpression getInput()
Get the inputFieldExpression
to compare against cases.
-
setInput
public void setInput(FieldExpression value)
Get the inputFieldExpression
to 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 theFieldExpression
that will provide the output if no cases match.
-
setDefaultOutput
public void setDefaultOutput(FieldExpression value)
Set theFieldExpression
that 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:
rewrite
in classFieldExpression
-
forEachField
public FieldExpression forEachField(java.util.function.Function<FieldExpression,FieldExpression> handler)
- Overrides:
forEachField
in classFieldExpression
-
hashCode
public int hashCode()
Description copied from class:FieldExpression
- Overrides:
hashCode
in classFieldExpression
-
equals
public final boolean equals(java.lang.Object other)
- Overrides:
equals
in 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:
toString
in classFieldExpression
-
valueOf
public static Switch valueOf(StringParser reader)
-
-