public static AttributeValue createAttributeValue(Long longValue) { if (longValue == null) { throw new IllegalArgumentException("Number AttributeValues cannot be null."); } return AttributeValue.builder().n(longValue.toString()).build(); }
public static AttributeValue createAttributeValue(Long longValue) { if (longValue == null) { throw new IllegalArgumentException("Number AttributeValues cannot be null."); } return AttributeValue.builder().n(longValue.toString()).build(); }
private Map<String, AttributeValue> createOrderItem(final CreateOrderRequest order) { Map<String, AttributeValue> item = new HashMap<>(); item.put(ORDER_ID, AttributeValue.builder().s(UUID.randomUUID().toString()).build()); item.put("version", AttributeValue.builder().n("1").build()); item.put("customerId", AttributeValue.builder().s(validateCustomerId(order.getCustomerId())).build()); try { item.put("preTaxAmount", AttributeValue.builder().n(order.getPreTaxAmount().toString()).build()); } catch (NullPointerException e) { throw new IllegalArgumentException(PRE_TAX_AMOUNT_WAS_NULL); } try { item.put("postTaxAmount", AttributeValue.builder().n(order.getPostTaxAmount().toString()).build()); } catch (NullPointerException e) { throw new IllegalArgumentException(POST_TAX_AMOUNT_WAS_NULL); } return item; }
AttributeValue.builder().n(order.getPreTaxAmount().toString()).build()); } catch (NullPointerException e) { throw new IllegalArgumentException(PRE_TAX_AMOUNT_WAS_NULL); AttributeValue.builder().n(order.getPostTaxAmount().toString()).build()); } catch (NullPointerException e) { throw new IllegalArgumentException(POST_TAX_AMOUNT_WAS_NULL); expressionAttributeValues.put(":o", AttributeValue.builder().n("1").build()); try { expressionAttributeValues.put(":v", AttributeValue.builder().n(order.getVersion().toString()).build()); } catch (NullPointerException e) { throw new IllegalArgumentException(VERSION_WAS_NULL);