Example usage for com.amazonaws.services.dynamodbv2.document Item isPresent

List of usage examples for com.amazonaws.services.dynamodbv2.document Item isPresent

Introduction

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

Prototype

public boolean isPresent(String attrName) 

Source Link

Document

Returns true if this item contains the specified attribute; false otherwise.

Usage

From source file:com.netflix.hollow.example.consumer.infrastructure.DynamoDBAnnouncementWatcher.java

License:Apache License

public long readLatestVersion() {
    Table table = dynamoDB.getTable(tableName);

    Item item = table.getItem("namespace", blobNamespace, "version, pin_version", null);

    if (item.isPresent("pin_version") && !item.isNull("pin_version"))
        return item.getLong("pin_version");

    return item.getLong("version");
}