@Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class Expression extends Object implements Serializable, Cloneable, StructuredPojo
Use Expression
to filter in the GetFreeTierUsage
API operation.
You can use the following patterns:
Simple dimension values (Dimensions
root operator)
Complex expressions with logical operators (AND
, NOT
, and OR
root operators).
For simple dimension values, you can set the dimension name, values, and match type for the filters that you plan to use.
Example for simple dimension values
You can filter to match exactly for REGION==us-east-1 OR REGION==us-west-1
.
The corresponding Expression
appears like the following:
{ "Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ], "MatchOptions": ["EQUALS"] } }
As shown in the previous example, lists of dimension values are combined with OR
when you apply the
filter.
For complex expressions with logical operators, you can have nested expressions to use the logical operators and specify advanced filtering.
Example for complex expressions with logical operators
You can filter by
((REGION == us-east-1 OR REGION == us-west-1) OR (SERVICE CONTAINS AWSLambda)) AND (USAGE_TYPE !CONTAINS DataTransfer)
.
The corresponding Expression
appears like the following:
{ "And": [ {"Or": [ {"Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ], "MatchOptions": ["EQUALS"] }}, {"Dimensions": { "Key": "SERVICE", "Values": ["AWSLambda"], "MatchOptions": ["CONTAINS"] } } ]}, {"Not": {"Dimensions": { "Key": "USAGE_TYPE", "Values": ["DataTransfer"], "MatchOptions": ["CONTAINS"] }}} ] }
In the following Contents, you must specify exactly one of the following root operators.
Constructor and Description |
---|
Expression() |
Modifier and Type | Method and Description |
---|---|
Expression |
clone() |
boolean |
equals(Object obj) |
List<Expression> |
getAnd()
Return results that match all
Expressions that you specified in the array. |
DimensionValues |
getDimensions()
The specific dimension, values, and match type to filter objects with.
|
Expression |
getNot()
Return results that don’t match the
Expression that you specified. |
List<Expression> |
getOr()
Return results that match any of the
Expressions that you specified. |
int |
hashCode() |
void |
marshall(ProtocolMarshaller protocolMarshaller)
Marshalls this structured data using the given
ProtocolMarshaller . |
void |
setAnd(Collection<Expression> and)
Return results that match all
Expressions that you specified in the array. |
void |
setDimensions(DimensionValues dimensions)
The specific dimension, values, and match type to filter objects with.
|
void |
setNot(Expression not)
Return results that don’t match the
Expression that you specified. |
void |
setOr(Collection<Expression> or)
Return results that match any of the
Expressions that you specified. |
String |
toString()
Returns a string representation of this object.
|
Expression |
withAnd(Collection<Expression> and)
Return results that match all
Expressions that you specified in the array. |
Expression |
withAnd(Expression... and)
Return results that match all
Expressions that you specified in the array. |
Expression |
withDimensions(DimensionValues dimensions)
The specific dimension, values, and match type to filter objects with.
|
Expression |
withNot(Expression not)
Return results that don’t match the
Expression that you specified. |
Expression |
withOr(Collection<Expression> or)
Return results that match any of the
Expressions that you specified. |
Expression |
withOr(Expression... or)
Return results that match any of the
Expressions that you specified. |
public List<Expression> getAnd()
Return results that match all Expressions
that you specified in the array.
Expressions
that you specified in the array.public void setAnd(Collection<Expression> and)
Return results that match all Expressions
that you specified in the array.
and
- Return results that match all Expressions
that you specified in the array.public Expression withAnd(Expression... and)
Return results that match all Expressions
that you specified in the array.
NOTE: This method appends the values to the existing list (if any). Use
setAnd(java.util.Collection)
or withAnd(java.util.Collection)
if you want to override the
existing values.
and
- Return results that match all Expressions
that you specified in the array.public Expression withAnd(Collection<Expression> and)
Return results that match all Expressions
that you specified in the array.
and
- Return results that match all Expressions
that you specified in the array.public void setDimensions(DimensionValues dimensions)
The specific dimension, values, and match type to filter objects with.
dimensions
- The specific dimension, values, and match type to filter objects with.public DimensionValues getDimensions()
The specific dimension, values, and match type to filter objects with.
public Expression withDimensions(DimensionValues dimensions)
The specific dimension, values, and match type to filter objects with.
dimensions
- The specific dimension, values, and match type to filter objects with.public void setNot(Expression not)
Return results that don’t match the Expression
that you specified.
not
- Return results that don’t match the Expression
that you specified.public Expression getNot()
Return results that don’t match the Expression
that you specified.
Expression
that you specified.public Expression withNot(Expression not)
Return results that don’t match the Expression
that you specified.
not
- Return results that don’t match the Expression
that you specified.public List<Expression> getOr()
Return results that match any of the Expressions
that you specified. in the array.
Expressions
that you specified. in the array.public void setOr(Collection<Expression> or)
Return results that match any of the Expressions
that you specified. in the array.
or
- Return results that match any of the Expressions
that you specified. in the array.public Expression withOr(Expression... or)
Return results that match any of the Expressions
that you specified. in the array.
NOTE: This method appends the values to the existing list (if any). Use
setOr(java.util.Collection)
or withOr(java.util.Collection)
if you want to override the
existing values.
or
- Return results that match any of the Expressions
that you specified. in the array.public Expression withOr(Collection<Expression> or)
Return results that match any of the Expressions
that you specified. in the array.
or
- Return results that match any of the Expressions
that you specified. in the array.public String toString()
toString
in class Object
Object.toString()
public Expression clone()
public void marshall(ProtocolMarshaller protocolMarshaller)
StructuredPojo
ProtocolMarshaller
.marshall
in interface StructuredPojo
protocolMarshaller
- Implementation of ProtocolMarshaller
used to marshall this object's data.