@Override public Object unmarshall(AttributeValue value) { Set<Short> result = new HashSet<Short>(); for (String s : value.getNS()) { result.add(Short.valueOf(s)); } return result; } }
@Override public Object unmarshall(AttributeValue value) { Set<Byte> result = new HashSet<Byte>(); for (String s : value.getNS()) { result.add(Byte.valueOf(s)); } return result; } }
@Override public Object unmarshall(AttributeValue value) { Set<Float> result = new HashSet<Float>(); for (String s : value.getNS()) { result.add(Float.valueOf(s)); } return result; } }
@Override public Object unmarshall(AttributeValue value) { Set<Long> result = new HashSet<Long>(); for (String s : value.getNS()) { result.add(Long.valueOf(s)); } return result; } }
@Override public Object unmarshall(AttributeValue value) { Set<BigInteger> result = new HashSet<BigInteger>(); for (String s : value.getNS()) { result.add(new BigInteger(s)); } return result; } }
@Override public Object unmarshall(AttributeValue value) { Set<Integer> result = new HashSet<Integer>(); for (String s : value.getNS()) { result.add(Integer.valueOf(s)); } return result; } }
@Override public Object unmarshall(AttributeValue value) { Set<BigDecimal> result = new HashSet<BigDecimal>(); for (String s : value.getNS()) { result.add(new BigDecimal(s)); } return result; } }
@Override public Object unmarshall(AttributeValue value) { Set<Double> result = new HashSet<Double>(); for (String s : value.getNS()) { result.add(Double.valueOf(s)); } return result; } }
@Override public void typeCheck(AttributeValue value, Method setter) { if ( value.getNS() == null ) { throw new DynamoDBMappingException("Expected NS in value " + value + " when invoking " + setter); } }
@Override public void typeCheck(AttributeValue value, Method setter) { if (value.getNS() == null && value.getL() == null) { throw new DynamoDBMappingException( "Expected either L or NS in value " + value + " when invoking " + setter); } }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getS() == null) ? 0 : getS().hashCode()); hashCode = prime * hashCode + ((getN() == null) ? 0 : getN().hashCode()); hashCode = prime * hashCode + ((getB() == null) ? 0 : getB().hashCode()); hashCode = prime * hashCode + ((getSS() == null) ? 0 : getSS().hashCode()); hashCode = prime * hashCode + ((getNS() == null) ? 0 : getNS().hashCode()); hashCode = prime * hashCode + ((getBS() == null) ? 0 : getBS().hashCode()); hashCode = prime * hashCode + ((getM() == null) ? 0 : getM().hashCode()); hashCode = prime * hashCode + ((getL() == null) ? 0 : getL().hashCode()); hashCode = prime * hashCode + ((getNULL() == null) ? 0 : getNULL().hashCode()); hashCode = prime * hashCode + ((getBOOL() == null) ? 0 : getBOOL().hashCode()); return hashCode; }
@Override public Object unmarshall(AttributeValue value) { if (value.getL() != null) { return unmarshallList(value.getL()); } else { return unmarshallNS(value.getNS()); } }
.withBS(entry.getValue().getBS()) .withN(entry.getValue().getN()) .withNS(entry.getValue().getNS()) .withS(entry.getValue().getS()) .withSS(entry.getValue().getSS())
@Override protected void onNonKeyAttribute(String attributeName, AttributeValue currentValue) { /* If it's a set attribute and the mapper is configured with APPEND_SET, * we do an "ADD" update instead of the default "PUT". */ if (getLocalSaveBehavior() == SaveBehavior.APPEND_SET) { if (currentValue.getBS() != null || currentValue.getNS() != null || currentValue.getSS() != null) { getAttributeValueUpdates().put( attributeName, new AttributeValueUpdate().withValue( currentValue).withAction("ADD")); return; } } /* Otherwise, we do the default "PUT" update. */ super.onNonKeyAttribute(attributeName, currentValue); }
/** * Marshall the given parameter object. */ public void marshall(AttributeValue attributeValue, ProtocolMarshaller protocolMarshaller) { if (attributeValue == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(attributeValue.getS(), S_BINDING); protocolMarshaller.marshall(attributeValue.getN(), N_BINDING); protocolMarshaller.marshall(attributeValue.getB(), B_BINDING); protocolMarshaller.marshall(attributeValue.getSS(), SS_BINDING); protocolMarshaller.marshall(attributeValue.getNS(), NS_BINDING); protocolMarshaller.marshall(attributeValue.getBS(), BS_BINDING); protocolMarshaller.marshall(attributeValue.getM(), M_BINDING); protocolMarshaller.marshall(attributeValue.getL(), L_BINDING); protocolMarshaller.marshall(attributeValue.getNULL(), NULL_BINDING); protocolMarshaller.marshall(attributeValue.getBOOL(), BOOL_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
@Override public Object unmarshall(AttributeValue value) { final Set<Long> result = new HashSet<Long>(); for (final String s : value.getNS()) { result.add(Long.valueOf(s)); } return result; } }
@Override public Object unmarshall(AttributeValue value) { final Set<Double> result = new HashSet<Double>(); for (final String s : value.getNS()) { result.add(Double.valueOf(s)); } return result; } }