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

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

Introduction

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

Prototype

public Set<String> getStringSet(String attrName) 

Source Link

Document

Returns the value of the specified attribute in the current item as a set of strings; or null if the attribute either doesn't exist or the attribute value is null.

Usage

From source file:com.exorath.service.party.service.DynamoDatabaseProvider.java

License:Apache License

/**
 * Convert an item containing information about a party into a party object
 *
 * @param item The item containing the information
 * @return A party object containing all possible information from the item
 *//*w  ww.j a  v a 2 s  . c o m*/
private Party getPartyFromItem(Item item) {
    String owner_uuid = item.hasAttribute(OWNER_UUID) ? item.getString(OWNER_UUID) : null;
    String party_uuid = item.hasAttribute(PARTY_UUID) ? item.getString(PARTY_UUID) : null;
    String serverId = item.hasAttribute(SERVER_ID) ? item.getString(SERVER_ID) : null;
    ArrayList<String> members = item.hasAttribute(MEMBERS) ? new ArrayList<>(item.getStringSet(MEMBERS)) : null;
    Long expiry = item.hasAttribute(EXPIRE) ? item.getLong(EXPIRE) : null;
    return new Party(party_uuid, owner_uuid, serverId, members, expiry);
}