T
- The object type.V
- The field model type.public class DynamoDBMapperFieldModel<T,V> extends Object implements DynamoDBAutoGenerator<V>, DynamoDBTypeConverter<AttributeValue,V>
Modifier and Type | Class and Description |
---|---|
static class |
DynamoDBMapperFieldModel.DynamoDBAttributeType |
static class |
DynamoDBMapperFieldModel.Id<T>
The field's "global" identifier.
|
DynamoDBTypeConverter.Factory
Constructor and Description |
---|
DynamoDBMapperFieldModel(String dynamoDBAttributeName,
DynamoDBMapperFieldModel.DynamoDBAttributeType dynamoDBAttributeType,
ArgumentMarshaller argumentMarshaller)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
boolean |
anyKey(KeyType... keyTypes)
Returns true if the field matches any key or index key.
|
Condition |
beginsWith(V value)
Creates a condition which filters on the specified value.
|
Condition |
between(V lo,
V hi)
Creates a condition which filters on the specified values.
|
Condition |
betweenAny(V lo,
V hi)
Creates a condition which filters on any non-null argument; if
lo
is null a LE condition is applied on hi , if hi
is null a GE condition is applied on lo . |
boolean |
canGenerate(T object,
DynamoDBMapperConfig.SaveBehavior saveBehavior,
DynamoDBMapperTableModel<T> model)
Determines if the mapping value can be auto-generated.
|
Condition |
contains(V value)
Creates a condition which filters on the specified value.
|
AttributeValue |
convert(V object)
Turns an object of type T into an object of type S.
|
Collection<AttributeValue> |
convertAll(Collection<V> values)
Converts the object values into
AttributeValue s. |
AttributeDefinition |
definition()
Gets the attribute deinition for this field.
|
Condition |
eq(V value)
Creates a condition which filters on the specified value.
|
ExpectedAttributeValue |
expectedExists(V value)
Creates an expectation that the value should exist.
|
ExpectedAttributeValue |
expectedIfExists(V value)
Creates an expectation that the value should exist if the value is not
null or an expectation that the value should not exist otherwise.
|
ExpectedAttributeValue |
expectedNotExists()
Creates an expectation that the value should not exist.
|
Condition |
ge(V value)
Creates a condition which filters on the specified value.
|
V |
generate(V currentValue)
Generates a new value given the current value (or null) if applicable.
|
AttributeValue |
generateAndConvert(T object)
Get the current value from the object and generates a new value.
|
V |
get(T object)
Gets the value from the object instance.
|
AttributeValue |
getAndConvert(T object)
Get the current value from the object and convert it.
|
String |
getDynamoDBAttributeName()
Returns the name of the DynamoDB attribute this mapped field will be
stored as.
|
DynamoDBMapperFieldModel.DynamoDBAttributeType |
getDynamoDBAttributeType()
Returns the type of the DynamoDB attribute this mapped field will be
stored as.
|
DynamoDBAutoGenerateStrategy |
getGenerateStrategy()
Gets the auto-generate strategy.
|
List<String> |
globalSecondaryIndexNames(KeyType keyType)
Gets the global secondary indexes.
|
Condition |
gt(V value)
Creates a condition which filters on the specified value.
|
DynamoDBMapperFieldModel.Id<T> |
id()
Gets the ID.
|
Condition |
in(Collection<V> values)
Creates a condition which filters on the specified values.
|
Condition |
in(V... values)
Creates a condition which filters on the specified values.
|
Condition |
isNull()
Creates a condition which filters on the specified value.
|
KeyType |
keyType()
Gets the key type.
|
Condition |
le(V value)
Creates a condition which filters on the specified value.
|
List<String> |
localSecondaryIndexNames()
Gets the local secondary indexes.
|
Condition |
lt(V value)
Creates a condition which filters on the specified value.
|
String |
name()
Gets the attribute name.
|
Condition |
ne(V value)
Creates a condition which filters on the specified value.
|
Condition |
notContains(V value)
Creates a condition which filters on the specified value.
|
Condition |
notNull()
Creates a condition which filters on the specified value.
|
void |
set(T object,
V value)
Sets the value on the object instance.
|
V |
unconvert(AttributeValue object)
Turns an object of type S into an objext of type T.
|
Collection<V> |
unconvertAll(Collection<AttributeValue> values)
Unconverts the
AttributeValue s into the object value. |
void |
unconvertAndSet(T object,
AttributeValue value)
Unconverts the value and sets it on the object.
|
boolean |
versioned()
Indicates if this attribute is a version attribute.
|
@Deprecated public DynamoDBMapperFieldModel(String dynamoDBAttributeName, DynamoDBMapperFieldModel.DynamoDBAttributeType dynamoDBAttributeType, ArgumentMarshaller argumentMarshaller)
public String getDynamoDBAttributeName()
public DynamoDBMapperFieldModel.DynamoDBAttributeType getDynamoDBAttributeType()
public final DynamoDBMapperFieldModel.Id<T> id()
public final String name()
public final V get(T object)
object
- The object instance.public final void set(T object, V value)
object
- The object instance.value
- The value.public final boolean canGenerate(T object, DynamoDBMapperConfig.SaveBehavior saveBehavior, DynamoDBMapperTableModel<T> model)
object
- The object instance.saveBehavior
- The save behaviour.model
- The table model.public final boolean versioned()
public final DynamoDBAutoGenerateStrategy getGenerateStrategy()
getGenerateStrategy
in interface DynamoDBAutoGenerator<V>
public final V generate(V currentValue)
generate
in interface DynamoDBAutoGenerator<V>
public final AttributeValue convert(V object)
convert
in interface DynamoDBTypeConverter<AttributeValue,V>
public final V unconvert(AttributeValue object)
unconvert
in interface DynamoDBTypeConverter<AttributeValue,V>
public final KeyType keyType()
public final List<String> globalSecondaryIndexNames(KeyType keyType)
keyType
- The key type.public final List<String> localSecondaryIndexNames()
public final boolean anyKey(KeyType... keyTypes)
keyTypes
- The key types.public final AttributeDefinition definition()
public final AttributeValue generateAndConvert(T object)
object
- The object instance.public final AttributeValue getAndConvert(T object)
object
- The object instance.public final void unconvertAndSet(T object, AttributeValue value)
object
- The object instance.value
- The attribute value.public final Collection<AttributeValue> convertAll(Collection<V> values)
AttributeValue
s.values
- The object values.public final Collection<V> unconvertAll(Collection<AttributeValue> values)
AttributeValue
s into the object value.values
- The attribute values.public final ExpectedAttributeValue expectedExists(V value)
value
- The value.DynamoDBSaveExpression.withExpectedEntry(java.lang.String, com.amazonaws.services.dynamodbv2.model.ExpectedAttributeValue)
,
DynamoDBDeleteExpression.withExpectedEntry(java.lang.String, com.amazonaws.services.dynamodbv2.model.ExpectedAttributeValue)
,
ExpectedAttributeValue
public final ExpectedAttributeValue expectedNotExists()
DynamoDBSaveExpression.withExpectedEntry(java.lang.String, com.amazonaws.services.dynamodbv2.model.ExpectedAttributeValue)
,
DynamoDBDeleteExpression.withExpectedEntry(java.lang.String, com.amazonaws.services.dynamodbv2.model.ExpectedAttributeValue)
,
ExpectedAttributeValue
public final ExpectedAttributeValue expectedIfExists(V value)
value
- The value.DynamoDBSaveExpression.withExpectedEntry(java.lang.String, com.amazonaws.services.dynamodbv2.model.ExpectedAttributeValue)
,
DynamoDBDeleteExpression.withExpectedEntry(java.lang.String, com.amazonaws.services.dynamodbv2.model.ExpectedAttributeValue)
,
ExpectedAttributeValue
public final Condition beginsWith(V value)
value
- The value.ComparisonOperator.BEGINS_WITH
,
Condition
public final Condition between(V lo, V hi)
lo
- The start of the range (inclusive).hi
- The end of the range (inclusive).ComparisonOperator.BETWEEN
,
Condition
public final Condition contains(V value)
value
- The value.ComparisonOperator.CONTAINS
,
Condition
public final Condition eq(V value)
value
- The value.ComparisonOperator.EQ
,
Condition
public final Condition ge(V value)
value
- The value.ComparisonOperator.GE
,
Condition
public final Condition gt(V value)
value
- The value.ComparisonOperator.GT
,
Condition
public final Condition in(V... values)
values
- The values.ComparisonOperator.IN
,
Condition
public final Condition in(Collection<V> values)
values
- The values.ComparisonOperator.IN
,
Condition
public final Condition isNull()
ComparisonOperator.NULL
,
Condition
public final Condition le(V value)
value
- The value.ComparisonOperator.LE
,
Condition
public final Condition lt(V value)
value
- The value.ComparisonOperator.LT
,
Condition
public final Condition ne(V value)
value
- The value.ComparisonOperator.NE
,
Condition
public final Condition notContains(V value)
value
- The value.ComparisonOperator.NOT_CONTAINS
,
Condition
public final Condition notNull()
ComparisonOperator.NOT_NULL
,
Condition
public final Condition betweenAny(V lo, V hi)
lo
is null a LE
condition is applied on hi
, if hi
is null a GE
condition is applied on lo
.lo
- The start of the range (inclusive).hi
- The end of the range (inclusive).ComparisonOperator.BETWEEN
,
ComparisonOperator.EQ
,
ComparisonOperator.GE
,
ComparisonOperator.LE
,
Condition
Copyright © 2016. All rights reserved.