public Expression build() {
        final Map<String, AttributeValue> attributeValues = Maps.newHashMap();

        // This might be used for a DeleteItem, in which case the update expression should be null
        String updateExpression = null;
        if (value != null) {
            updateExpression = SET_VALUE_EXPR;
            final AttributeValue updateValue = encodeValue(value);
            attributeValues.put(VALUE_LABEL, updateValue);
        }

        // Condition expression and attribute value
        String conditionExpression = null;
        if (transaction.contains(store, hashKey, rangeKey)) {
            final StaticBuffer expectedValue = transaction.get(store, hashKey, rangeKey);
            if (expectedValue == null) {
                conditionExpression = MISSING_VALUE_EXPR;
            } else {
                final AttributeValue expectedAttributeValue = encodeValue(expectedValue);
                conditionExpression = EXPECTED_VALUE_EXPR;
                attributeValues.put(EXPECTED_VALUE_LABEL, expectedAttributeValue);
            }
        }

        // We aren't using any Titan column names in the expressions for MULTI records, so we don't need to label any argument names.
        return new Expression(updateExpression, conditionExpression, attributeValues);
    }
public Expression build ( ) { final Map < String , AttributeValue > attributeValues = Maps . newHashMap ( ) ; String updateExpression = null ; if ( value != null ) { updateExpression = SET_VALUE_EXPR ; final AttributeValue updateValue = encodeValue ( value ) ; attributeValues . put ( VALUE_LABEL , updateValue ) ; } String conditionExpression = null ; if ( transaction . contains ( store , hashKey , rangeKey ) ) { final StaticBuffer expectedValue = transaction . get ( store , hashKey , rangeKey ) ; if ( expectedValue == null ) { conditionExpression = MISSING_VALUE_EXPR ; } else { final AttributeValue expectedAttributeValue = encodeValue ( expectedValue ) ; conditionExpression = EXPECTED_VALUE_EXPR ; attributeValues . put ( EXPECTED_VALUE_LABEL , expectedAttributeValue ) ; } } return new Expression ( updateExpression , conditionExpression , attributeValues ) ; }
@return