/** * Converts a map of string to simple objects into the low-level * representation; or null if the input is null. */ public static Map<String, AttributeValue> fromSimpleMap( Map<String, Object> map) { return ItemUtils.fromSimpleMap(map); }
public static <T> Map<String, T> toSimpleMapValue( Map<String, AttributeValue> values) { return ItemUtils.toSimpleMapValue(values); }
public static void checkInvalidAttrName(String attrName) { ItemUtils.checkInvalidAttrName(attrName); }
} else if (value.getL() != null) { @SuppressWarnings("unchecked") T t = (T) toSimpleList(value.getL()); return t; } else if (value.getM() != null) { @SuppressWarnings("unchecked") T t = (T) toSimpleMapValue(value.getM()); return t; } else {
/** * Converts the specified primary key into the low-level representation. */ public static Map<String, AttributeValue> toAttributeValueMap( KeyAttribute... primaryKey) { return ItemUtils.toAttributeValueMap(primaryKey); }
/** * Converts a simple value into the low-level <code><AttributeValue/code> * representation. * * @param value the given value which can be one of the followings: * <ul> * <li>String</li> * <li>Set<String></li> * <li>Number (including any subtypes and primitive types)</li> * <li>Set<Number></li> * <li>byte[]</li> * <li>Set<byte[]></li> * <li>ByteBuffer</li> * <li>Set<ByteBuffer></li> * <li>Boolean or boolean</li> * <li>null</li> * <li>Map<String,T>, where T can be any type on this list but must not * induce any circular reference</li> * <li>List<T>, where T can be any type on this list but must not induce * any circular reference</li> * </ul> * @return a non-null low level representation of the input object value * @throws UnsupportedOperationException if the input object type is not supported */ public static AttributeValue toAttributeValue(Object value) { return ItemUtils.toAttributeValue(value); }
/** * Converts an <code>Item</code> into the low-level representation; * or null if the input is null. */ public static Map<String, AttributeValue> toAttributeValues(Item item) { return ItemUtils.toAttributeValues(item); }
/** * Returns the minimum of the two input integers taking null into account. * Returns null if both integers are null. Otherwise, a null Integer is * treated as infinity. */ public static Integer minimum(Integer one, Integer two) { return ItemUtils.minimum(one, two); }
/** * Returns the low level representation of a collection of <code>Filter</code>. */ public static Map<String, Condition> toAttributeConditionMap(Collection<? extends Filter<?>> filters) { return ItemUtils.toAttributeConditionMap(filters); }
/** * Converts a list of <code>AttributeUpdate</code> into the low-level * representation; or null if the input is null. */ public static Map<String, AttributeValueUpdate> toAttributeValueUpdate( List<AttributeUpdate> attributesToUpdate) { return ItemUtils.toAttributeValueUpdate(attributesToUpdate); }
public static void checkInvalidAttribute(String attrName, Object val) { ItemUtils.checkInvalidAttribute(attrName, val); } }
} else if (value.getL() != null) { @SuppressWarnings("unchecked") T t = (T) toSimpleList(value.getL()); return t; } else if (value.getM() != null) { @SuppressWarnings("unchecked") T t = (T) toSimpleMapValue(value.getM()); return t; } else {
/** * Converts the specified primary key into the low-level representation. */ public static Map<String, AttributeValue> toAttributeValueMap( Collection<KeyAttribute> primaryKey) { return ItemUtils.toAttributeValueMap(primaryKey); }
/** * Converts a map of string to simple objects into the low-level * representation; or null if the input is null. */ public static Map<String, AttributeValue> fromSimpleMap( Map<String, Object> map) { if (map == null) return null; // row with multiple attributes Map<String, AttributeValue> result = new LinkedHashMap<String, AttributeValue>(); for (Map.Entry<String, Object> entry : map.entrySet()) result.put(entry.getKey(), toAttributeValue(entry.getValue())); return result; }
/** * Converts the input array of values into an array of low level * representation of those values. * * A value in the input array can be one of the followings: * * <ul> * <li>String</li> * <li>Set<String></li> * <li>Number (including any subtypes and primitive types)</li> * <li>Set<Number></li> * <li>byte[]</li> * <li>Set<byte[]></li> * <li>ByteBuffer</li> * <li>Set<ByteBuffer></li> * <li>Boolean or boolean</li> * <li>null</li> * <li>Map<String,T>, where T can be any type on this list but must not * induce any circular reference</li> * <li>List<T>, where T can be any type on this list but must not induce * any circular reference</li> * </ul> */ public static AttributeValue[] toAttributeValues(Object[] values) { return ItemUtils.toAttributeValues(values); }
/** * Returns the minimum of the two input integers taking null into account. * Returns null if both integers are null. Otherwise, a null Integer is * treated as infinity. */ public static Integer minimum(Integer one, Integer two) { return ItemUtils.minimum(one, two); }
/** * Returns the low level representation of a collection of <code>Filter</code>. */ public static Map<String, Condition> toAttributeConditionMap(Collection<? extends Filter<?>> filters) { return ItemUtils.toAttributeConditionMap(filters); }
/** * Converts a list of <code>AttributeUpdate</code> into the low-level * representation; or null if the input is null. */ public static Map<String, AttributeValueUpdate> toAttributeValueUpdate( List<AttributeUpdate> attributesToUpdate) { return ItemUtils.toAttributeValueUpdate(attributesToUpdate); }
public static void checkInvalidAttribute(String attrName, Object val) { ItemUtils.checkInvalidAttribute(attrName, val); } }
/** * Returns an <code>Item</code> given the low level item information; * or null if the input is null; */ public static Item toItem(Map<String, AttributeValue> item) { if (item == null) { return null; } return Item.fromMap(toSimpleMapValue(item)); }