summaryrefslogtreecommitdiff
path: root/src/com/p4square/grow/backend/dynamo/DynamoKey.java
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2014-05-23 22:40:39 -0700
committerJesse Morgan <jesse@jesterpm.net>2014-05-23 22:40:39 -0700
commitd90c6f8ef2c9b630a39f7e6cbf65897dc2f62011 (patch)
tree422e40c724c56088af0bca376baa7a56634f9251 /src/com/p4square/grow/backend/dynamo/DynamoKey.java
parentef862e30975db691339fd143d2c4d60eb5132a3e (diff)
Adding dynamo support.
Diffstat (limited to 'src/com/p4square/grow/backend/dynamo/DynamoKey.java')
-rw-r--r--src/com/p4square/grow/backend/dynamo/DynamoKey.java56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/com/p4square/grow/backend/dynamo/DynamoKey.java b/src/com/p4square/grow/backend/dynamo/DynamoKey.java
new file mode 100644
index 0000000..5cdbacd
--- /dev/null
+++ b/src/com/p4square/grow/backend/dynamo/DynamoKey.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2014 Jesse Morgan
+ */
+
+package com.p4square.grow.backend.dynamo;
+
+/**
+ * DynamoKey represents a table, hash key, and range key tupl.
+ */
+public class DynamoKey {
+ private final String mTable;
+ private final String mHashKey;
+ private final String mRangeKey;
+ private final String mAttribute;
+
+ public static DynamoKey newKey(final String table, final String hashKey) {
+ return new DynamoKey(table, hashKey, null, null);
+ }
+
+ public static DynamoKey newRangeKey(final String table, final String hashKey,
+ final String rangeKey) {
+
+ return new DynamoKey(table, hashKey, rangeKey, null);
+ }
+
+ public static DynamoKey newAttributeKey(final String table, final String hashKey,
+ final String attribute) {
+
+ return new DynamoKey(table, hashKey, null, attribute);
+ }
+
+ public DynamoKey(final String table, final String hashKey, final String rangeKey,
+ final String attribute) {
+
+ mTable = table;
+ mHashKey = hashKey;
+ mRangeKey = rangeKey;
+ mAttribute = attribute;
+ }
+
+ public String getTable() {
+ return mTable;
+ }
+
+ public String getHashKey() {
+ return mHashKey;
+ }
+
+ public String getRangeKey() {
+ return mRangeKey;
+ }
+
+ public String getAttribute() {
+ return mAttribute;
+ }
+}