@SuppressWarnings("unchecked")
    public <T extends Number> Map<String, T> getMapOfNumbers(String attrName,
            Class<T> valueType) {
        if (valueType == Short.class
        ||  valueType == Integer.class
        ||  valueType == Long.class
        ||  valueType == Float.class
        ||  valueType == Double.class
        ||  valueType == Number.class
        ||  valueType == BigDecimal.class
        ||  valueType == BigInteger.class) {
            final Map<String, BigDecimal> src =
                (Map<String, BigDecimal>)attributes.get(attrName);
            if (src == null)
                return null;
            final Map<String, T> dst = new LinkedHashMap<String, T>(src.size());
            for (Map.Entry<String,BigDecimal> e: src.entrySet()) {
                final String key = e.getKey();
                final BigDecimal val = e.getValue();
                if (val == null) {
                    dst.put(key, null);
                } else if (valueType == Short.class) {
                    dst.put(key, (T)Short.valueOf(val.shortValue()));
                } else if (valueType == Integer.class) {
                    dst.put(key, (T)Integer.valueOf(val.intValue()));
                } else if (valueType == Long.class) {
                    dst.put(key, (T)Long.valueOf(val.longValue()));
                } else if (valueType == Float.class) {
                    dst.put(key, (T)Float.valueOf(val.floatValue()));
                } else if (valueType == Double.class) {
                    dst.put(key, (T)Double.valueOf(val.doubleValue()));
                } else if (valueType == BigDecimal.class || valueType == Number.class) {
                    dst.put(key, (T)val);
                } else if (valueType == BigInteger.class) {
                    dst.put(key, (T)val.toBigInteger());
                }
            }
            return dst;
        } else {
            throw new UnsupportedOperationException("Value type " + valueType
                    + " is not currently supported");
        }
    }
Convenient method to return the specified attribute in the current item
as a (copy of) map of string-to-<code>T</code>'s where T must be a
subclass of <code>Number</code>; or null if the attribute doesn't
exist.

@param attrName
           the attribute name
@param valueType
           the specific number type of the value to be returned.
           Currently, only<ul>
           <li><code>Short</code></li>
           <li><code>Integer</code></li>
           <li><code>Long</code></li>
           <li><code>Float</code></li>
           <li><code>Double</code></li>
           <li><code>Number</code></li>
           <li><code>BigDecimal</code></li>
           <li><code>BigInteger</code></li>
           </ul>are supported.

@throws UnsupportedOperationException
            if the value type is not supported
@throws ClassCastException
            if the attribute is not a map of string to numbers
aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/Item.java