Example usage for com.amazonaws.services.dynamodbv2.model ScalarAttributeType B

List of usage examples for com.amazonaws.services.dynamodbv2.model ScalarAttributeType B

Introduction

In this page you can find the example usage for com.amazonaws.services.dynamodbv2.model ScalarAttributeType B.

Prototype

ScalarAttributeType B

To view the source code for com.amazonaws.services.dynamodbv2.model ScalarAttributeType B.

Click Source Link

Usage

From source file:jp.classmethod.aws.dynamodb.DynamoDbRepository.java

License:Open Source License

private static ScalarAttributeType scalarAttributeType(Object o) {
    if (o instanceof String) {
        return ScalarAttributeType.S;
    }/*from   ww  w  . j  av  a2s . c o  m*/
    if (o instanceof ByteBuffer) {
        return ScalarAttributeType.B;
    }
    if (o instanceof Number) {
        return ScalarAttributeType.N;
    }
    throw new IllegalArgumentException("Unsupported scalar type");
}

From source file:org.apache.metamodel.dynamodb.DynamoDbUtils.java

License:Apache License

public static ScalarAttributeType toAttributeType(ColumnType type) {
    if (type == null) {
        return ScalarAttributeType.S;
    }//from  ww w.ja  v a 2s  . c  o  m
    if (type.isBinary()) {
        return ScalarAttributeType.B;
    }
    if (type.isNumber()) {
        return ScalarAttributeType.S;
    }
    // default to string
    return ScalarAttributeType.S;
}