Example usage for com.amazonaws.services.dynamodbv2.document RangeKeyCondition eq

List of usage examples for com.amazonaws.services.dynamodbv2.document RangeKeyCondition eq

Introduction

In this page you can find the example usage for com.amazonaws.services.dynamodbv2.document RangeKeyCondition eq.

Prototype

public RangeKeyCondition eq(Object val) 

Source Link

Document

Creates and returns a condition of the range key being equal to the given value.

Usage

From source file:com.clicktravel.infrastructure.persistence.aws.dynamodb.RangeKeyConditionBuilder.java

License:Apache License

public static RangeKeyCondition build(final String attributeName, final Object value,
        final Operators comparisonOperator) {
    Check.isNotEmptyOrNull("attributeName", attributeName);
    Check.isNotNull("conditionValue", value);

    final RangeKeyCondition rangeKeyCondition = new RangeKeyCondition(attributeName);
    switch (comparisonOperator) {
    case EQUALS:/*from   ww w. ja v a 2  s.  c  o m*/
        rangeKeyCondition.eq(value);
        break;
    case GREATER_THAN_OR_EQUALS:
        rangeKeyCondition.ge(value);
        break;
    case LESS_THAN_OR_EQUALS:
        rangeKeyCondition.le(value);
        break;
    default:
        throw new InvalidConditionOperatorException(String
                .format("Operation %s not valid for range key condition.", comparisonOperator.toString()));
    }

    return rangeKeyCondition;
}