public class Elvis extends Object implements ValueExpression
ValueExpression that implements the Elvis operator:
?:.
An Elvis expression has two operands: left and
right (both ValueExpressions). Both operands are
evaluated. The return value is a list with the size of the longest list
returned by the two evaluations. At each index, the value at that index in
the result returned by evaluating left is placed, except if it
does not exist or is Optional.empty(), in which case the value at
that index in the result returned by evaluating right is placed there.
| Modifier and Type | Field and Description |
|---|---|
ValueExpression |
left |
ValueExpression |
right |
| Constructor and Description |
|---|
Elvis(ValueExpression left,
ValueExpression right) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
ImmutableList<Optional<Value>> |
eval(ParseState parseState,
Encoding encoding) |
int |
hashCode() |
String |
toString() |
public final ValueExpression left
public final ValueExpression right
public Elvis(ValueExpression left, ValueExpression right)
public ImmutableList<Optional<Value>> eval(ParseState parseState, Encoding encoding)
eval in interface ValueExpressionCopyright © 2017. All rights reserved.