Class ConditionExpression.Builder
java.lang.Object
dev.hogwai.dynamodb.simplified.expression.FilterExpression
dev.hogwai.dynamodb.simplified.expression.ConditionExpression.Builder
- Enclosing class:
ConditionExpression
Fluent builder for
ConditionExpression.
Extends FilterExpression to inherit all expression-building
capability, with covariant return types to preserve the builder type
through method chaining, and a terminal build() method.
-
Nested Class Summary
Nested classes/interfaces inherited from class FilterExpression
FilterExpression.AttributeType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NonNull ConditionExpression.Builderand()Appends anANDlogical operator to combine two filter conditions.@NonNull ConditionExpression.BuilderattributeType(@NonNull String attr, @NonNull FilterExpression.AttributeType type) Adds anattribute_typecondition that checks whether the specified attribute is of the given DynamoDB type.@NonNull ConditionExpression.BuilderbeginsWith(@NonNull String attr, @NonNull String prefix) Adds abegins_withfunction condition checking whether the attribute value starts with the given prefix.@NonNull ConditionExpression.BuilderAdds aBETWEENcondition:attribute BETWEEN low AND high(inclusive).@NonNull ConditionExpressionbuild()Builds theConditionExpression.@NonNull ConditionExpression.BuilderAdds acontainsfunction condition checking whether the attribute value contains the given substring (for strings) or element (for sets).@NonNull ConditionExpression.BuilderAdds an equality condition:attribute = value.@NonNull ConditionExpression.BuilderAdds anattribute_existscondition that checks whether the specified attribute is present on the item.@NonNull ConditionExpression.BuilderAdds a greater-than-or-equal condition:attribute >= value.@NonNull ConditionExpression.Buildergroup(@NonNull FilterExpression nested) Wraps the given nested expression in parentheses and merges its expression attribute names and values into this builder.@NonNull ConditionExpression.BuilderAdds a greater-than condition:attribute > value.@NonNull ConditionExpression.BuilderAdds anINcondition:attribute IN (val1, val2, ...).@NonNull ConditionExpression.BuilderAdds a less-than-or-equal condition:attribute <= value.@NonNull ConditionExpression.BuilderAdds a less-than condition:attribute < value.@NonNull ConditionExpression.BuilderAdds a not-equal condition:attribute <> value.@NonNull ConditionExpression.BuilderAdds an equality condition on a nested attribute path (e.g.,address.city).@NonNull ConditionExpression.Buildernot()Appends aNOTlogical operator to negate the following condition.@NonNull ConditionExpression.BuilderAdds anattribute_not_existscondition that checks whether the specified attribute is not present on the item.@NonNull ConditionExpression.Builderor()Appends anORlogical operator to combine two filter conditions.@NonNull ConditionExpression.BuildersizeBetween(@NonNull String attr, int min, int max) Adds a condition that the server-sidesize()of the attribute is between the given minimum and maximum values (inclusive).@NonNull ConditionExpression.BuilderAdds a condition that the server-sidesize()of the attribute equals the given value.@NonNull ConditionExpression.BuilderAdds a condition that the server-sidesize()of the attribute is greater than or equal to the given value.@NonNull ConditionExpression.BuilderAdds a condition that the server-sidesize()of the attribute is greater than the given value.@NonNull ConditionExpression.BuilderAdds a condition that the server-sidesize()of the attribute is less than or equal to the given value.@NonNull ConditionExpression.BuilderAdds a condition that the server-sidesize()of the attribute is less than the given value.Methods inherited from class FilterExpression
builder, getExpression, getExpressionNames, getExpressionValues, isEmpty, toSdkExpression
-
Constructor Details
-
Builder
public Builder()Creates a new condition expression builder.
-
-
Method Details
-
eq
Description copied from class:FilterExpressionAdds an equality condition:attribute = value.- Overrides:
eqin classFilterExpression- Parameters:
attr- the attribute namevalue- the value to compare against- Returns:
- this builder for chaining
-
ne
Description copied from class:FilterExpressionAdds a not-equal condition:attribute <> value.- Overrides:
nein classFilterExpression- Parameters:
attr- the attribute namevalue- the value to compare against- Returns:
- this builder for chaining
-
lt
Description copied from class:FilterExpressionAdds a less-than condition:attribute < value.- Overrides:
ltin classFilterExpression- Parameters:
attr- the attribute namevalue- the value to compare against- Returns:
- this builder for chaining
-
le
Description copied from class:FilterExpressionAdds a less-than-or-equal condition:attribute <= value.- Overrides:
lein classFilterExpression- Parameters:
attr- the attribute namevalue- the value to compare against- Returns:
- this builder for chaining
-
gt
Description copied from class:FilterExpressionAdds a greater-than condition:attribute > value.- Overrides:
gtin classFilterExpression- Parameters:
attr- the attribute namevalue- the value to compare against- Returns:
- this builder for chaining
-
ge
Description copied from class:FilterExpressionAdds a greater-than-or-equal condition:attribute >= value.- Overrides:
gein classFilterExpression- Parameters:
attr- the attribute namevalue- the value to compare against- Returns:
- this builder for chaining
-
beginsWith
public @NonNull ConditionExpression.Builder beginsWith(@NonNull String attr, @NonNull String prefix) Description copied from class:FilterExpressionAdds abegins_withfunction condition checking whether the attribute value starts with the given prefix.- Overrides:
beginsWithin classFilterExpression- Parameters:
attr- the attribute nameprefix- the string prefix to test- Returns:
- this builder for chaining
-
contains
Description copied from class:FilterExpressionAdds acontainsfunction condition checking whether the attribute value contains the given substring (for strings) or element (for sets).- Overrides:
containsin classFilterExpression- Parameters:
attr- the attribute namevalue- the value to search for within the attribute- Returns:
- this builder for chaining
-
sizeEq
Description copied from class:FilterExpressionAdds a condition that the server-sidesize()of the attribute equals the given value.- Overrides:
sizeEqin classFilterExpression- Parameters:
attr- the attribute namesize- the expected size- Returns:
- this builder for chaining
-
sizeLt
Description copied from class:FilterExpressionAdds a condition that the server-sidesize()of the attribute is less than the given value.- Overrides:
sizeLtin classFilterExpression- Parameters:
attr- the attribute namesize- the size to compare against- Returns:
- this builder for chaining
-
sizeLe
Description copied from class:FilterExpressionAdds a condition that the server-sidesize()of the attribute is less than or equal to the given value.- Overrides:
sizeLein classFilterExpression- Parameters:
attr- the attribute namesize- the size to compare against- Returns:
- this builder for chaining
-
sizeGt
Description copied from class:FilterExpressionAdds a condition that the server-sidesize()of the attribute is greater than the given value.- Overrides:
sizeGtin classFilterExpression- Parameters:
attr- the attribute namesize- the size to compare against- Returns:
- this builder for chaining
-
sizeGe
Description copied from class:FilterExpressionAdds a condition that the server-sidesize()of the attribute is greater than or equal to the given value.- Overrides:
sizeGein classFilterExpression- Parameters:
attr- the attribute namesize- the size to compare against- Returns:
- this builder for chaining
-
sizeBetween
Description copied from class:FilterExpressionAdds a condition that the server-sidesize()of the attribute is between the given minimum and maximum values (inclusive).- Overrides:
sizeBetweenin classFilterExpression- Parameters:
attr- the attribute namemin- the minimum sizemax- the maximum size- Returns:
- this builder for chaining
-
exists
Description copied from class:FilterExpressionAdds anattribute_existscondition that checks whether the specified attribute is present on the item.- Overrides:
existsin classFilterExpression- Parameters:
attr- the attribute name- Returns:
- this builder for chaining
-
notExists
Description copied from class:FilterExpressionAdds anattribute_not_existscondition that checks whether the specified attribute is not present on the item.- Overrides:
notExistsin classFilterExpression- Parameters:
attr- the attribute name- Returns:
- this builder for chaining
-
attributeType
public @NonNull ConditionExpression.Builder attributeType(@NonNull String attr, @NonNull FilterExpression.AttributeType type) Description copied from class:FilterExpressionAdds anattribute_typecondition that checks whether the specified attribute is of the given DynamoDB type.- Overrides:
attributeTypein classFilterExpression- Parameters:
attr- the attribute nametype- the expectedFilterExpression.AttributeType- Returns:
- this builder for chaining
-
between
public @NonNull ConditionExpression.Builder between(@NonNull String attr, @NonNull Object low, @NonNull Object high) Description copied from class:FilterExpressionAdds aBETWEENcondition:attribute BETWEEN low AND high(inclusive). Supports strings, numbers, and binaries.- Overrides:
betweenin classFilterExpression- Parameters:
attr- the attribute namelow- the lower boundhigh- the upper bound- Returns:
- this builder for chaining
-
in
Description copied from class:FilterExpressionAdds anINcondition:attribute IN (val1, val2, ...). The attribute must match at least one of the provided values.- Overrides:
inin classFilterExpression- Parameters:
attr- the attribute namevalues- one or more values to test against- Returns:
- this builder for chaining
-
and
Description copied from class:FilterExpressionAppends anANDlogical operator to combine two filter conditions.- Overrides:
andin classFilterExpression- Returns:
- this builder for chaining
-
or
Description copied from class:FilterExpressionAppends anORlogical operator to combine two filter conditions.- Overrides:
orin classFilterExpression- Returns:
- this builder for chaining
-
not
Description copied from class:FilterExpressionAppends aNOTlogical operator to negate the following condition.- Overrides:
notin classFilterExpression- Returns:
- this builder for chaining
-
group
Wraps the given nested expression in parentheses and merges its expression attribute names and values into this builder.- Overrides:
groupin classFilterExpression- Parameters:
nested- the expression to wrap in parentheses- Returns:
- this builder for chaining
-
nestedEq
Description copied from class:FilterExpressionAdds an equality condition on a nested attribute path (e.g.,address.city). Dot-separated path segments are resolved to individual expression attribute names, and list indices (e.g.,items[0]) are supported.- Overrides:
nestedEqin classFilterExpression- Parameters:
path- the nested attribute path (e.g.,"address.city")value- the value to compare against- Returns:
- this builder for chaining
-
build
Builds theConditionExpression.- Returns:
- a new condition expression with the accumulated conditions
-