public QuerySpec withHashKey(String hashKeyName, Object hashKeyValue) { this.hashKey = new KeyAttribute(hashKeyName, hashKeyValue); return this; }
/** * Converts the specified primary key into the low-level representation. */ public static Map<String, AttributeValue> toAttributeValueMap( Collection<KeyAttribute> primaryKey) { if (primaryKey == null) return null; Map<String, AttributeValue> keys = new LinkedHashMap<String, AttributeValue>(); for (KeyAttribute keyAttr : primaryKey) keys.put(keyAttr.getName(), InternalUtils.toAttributeValue(keyAttr.getValue())); return Collections.unmodifiableMap(keys); }
/** * Add one or multiple key components to this primary key. * * Note adding a key component with the same name as that of an existing * one would overwrite and become a single key component instead of two. */ public PrimaryKey addComponents(KeyAttribute ... components) { if (components != null) { for (KeyAttribute ka: components) { InternalUtils.rejectNullInput(ka); this.components.put(ka.getName(), ka); } } return this; }
/** * Add one or multiple key components to this primary key. * * Note adding a key component with the same name as that of an existing * one would overwrite and become a single key component instead of two. */ public PrimaryKey addComponents(KeyAttribute ... components) { if (components != null) { for (KeyAttribute ka: components) { InternalUtils.rejectNullInput(ka); this.components.put(ka.getName(), ka); } } return this; }
/** * Add a key component to this primary key. * * Note adding a key component with the same name as that of an existing * one would overwrite and become a single key component instead of two. */ public PrimaryKey addComponent(String keyAttributeName, Object keyAttributeValue) { components.put(keyAttributeName, new KeyAttribute(keyAttributeName, keyAttributeValue)); return this; }
public QuerySpec withExclusiveStartKey( String hashKeyName, Object hashKeyValue, String rangeKeyName, Object rangeKeyValue) { return withExclusiveStartKey( new KeyAttribute(hashKeyName, hashKeyValue), new KeyAttribute(rangeKeyName, rangeKeyValue)); }
/** * Convenient methods - sets the attributes of this item from the specified * key components. */ public Item withKeyComponents(KeyAttribute ...components) { rejectNullOrEmptyInput(components); for (KeyAttribute ka: components) { rejectNullValue(ka); this.with(ka.getName(), ka.getValue()); } return this; }
/** * @see ScanRequest#withExclusiveStartKey(Map) */ public ScanSpec withExclusiveStartKey( String hashKeyName, Object hashKeyValue, String rangeKeyName, Object rangeKeyValue) { return withExclusiveStartKey( new KeyAttribute(hashKeyName, hashKeyValue), new KeyAttribute(rangeKeyName, rangeKeyValue)); }
/** * Convenient methods - sets the attributes of this item from the given * key attributes. */ public Item withPrimaryKey(PrimaryKey primaryKey) { rejectNullValue(primaryKey); if (primaryKey.getComponents().size() == 0) throw new IllegalArgumentException("primary key must not be empty"); for (KeyAttribute ka: primaryKey.getComponents()) this.with(ka.getName(), ka.getValue()); return this; }
@Override public GetItemOutcome getItemOutcome(String hashKeyName, Object hashKeyValue, String rangeKeyName, Object rangeKeyValue) { return getItemOutcome(new KeyAttribute(hashKeyName, hashKeyValue), new KeyAttribute(rangeKeyName, rangeKeyValue)); }
/** * Converts the specified primary key into the low-level representation. */ public static Map<String, AttributeValue> toAttributeValueMap( Collection<KeyAttribute> primaryKey) { if (primaryKey == null) return null; Map<String, AttributeValue> keys = new LinkedHashMap<String, AttributeValue>(); for (KeyAttribute keyAttr : primaryKey) keys.put(keyAttr.getName(), InternalUtils.toAttributeValue(keyAttr.getValue())); return Collections.unmodifiableMap(keys); }
@Override public ItemCollection<QueryOutcome> query(String hashKeyName, Object hashKeyValue, RangeKeyCondition rangeKeyCondition) { return query(new KeyAttribute(hashKeyName, hashKeyValue), rangeKeyCondition); }
public QuerySpec withExclusiveStartKey( String hashKeyName, Object hashKeyValue) { return withExclusiveStartKey(new KeyAttribute(hashKeyName, hashKeyValue)); }
/** * Convenient methods - sets the attributes of this item from the specified * key components. */ public Item withKeyComponents(KeyAttribute ...components) { rejectNullOrEmptyInput(components); for (KeyAttribute ka: components) { rejectNullValue(ka); this.with(ka.getName(), ka.getValue()); } return this; }
@Override public ItemCollection<QueryOutcome> query(String hashKeyName, Object hashKeyValue, RangeKeyCondition rangeKeyCondition, QueryFilter... queryFilters) { return query(new KeyAttribute(hashKeyName, hashKeyValue), rangeKeyCondition, queryFilters); }
/** * Convenient methods - sets the attributes of this item from the given * key attributes. */ public Item withPrimaryKey(PrimaryKey primaryKey) { rejectNullValue(primaryKey); if (primaryKey.getComponents().size() == 0) throw new IllegalArgumentException("primary key must not be empty"); for (KeyAttribute ka: primaryKey.getComponents()) this.with(ka.getName(), ka.getValue()); return this; }
@Override public ItemCollection<QueryOutcome> query(String hashKeyName, Object hashKeyValue, RangeKeyCondition rangeKeyCondition, String filterExpression, Map<String, String> nameMap, Map<String, Object> valueMap) { return query(new KeyAttribute(hashKeyName, hashKeyValue), rangeKeyCondition, filterExpression, nameMap, valueMap); }
/** * @see ScanRequest#withExclusiveStartKey(Map) */ public ScanSpec withExclusiveStartKey( String hashKeyName, Object hashKeyValue) { return withExclusiveStartKey(new KeyAttribute(hashKeyName, hashKeyValue)); }