public StreamSpecification unmarshall(JsonUnmarshallerContext context) throws Exception { StreamSpecification streamSpecification = new StreamSpecification(); if (context.testExpression("StreamEnabled", targetDepth)) { context.nextToken(); streamSpecification.setStreamEnabled(context.getUnmarshaller(Boolean.class).unmarshall(context)); streamSpecification.setStreamViewType(context.getUnmarshaller(String.class).unmarshall(context));
withStreamViewType(streamViewType);
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getStreamEnabled() == null) ? 0 : getStreamEnabled().hashCode()); hashCode = prime * hashCode + ((getStreamViewType() == null) ? 0 : getStreamViewType().hashCode()); return hashCode; }
private void createTable() { dynamoDBClient.createTable(new CreateTableRequest() .withTableName(tableConfig.getTableName()).withKeySchema(PROJECT_KEYSCHEMA) .withAttributeDefinitions(ATTRIBUTES) .withStreamSpecification(new StreamSpecification().withStreamEnabled(true).withStreamViewType(StreamViewType.NEW_IMAGE)) .withProvisionedThroughput(new ProvisionedThroughput() .withReadCapacityUnits(1L) .withWriteCapacityUnits(1L))); }
.withKeyType(KeyType.HASH)); StreamSpecification streamSpecification = new StreamSpecification(); streamSpecification.setStreamEnabled(true); streamSpecification.setStreamViewType(StreamViewType.NEW_AND_OLD_IMAGES); System.out.println("Stream enabled: "+ myStreamSpec.getStreamEnabled()); System.out.println("Update view type: "+ myStreamSpec.getStreamViewType());
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAttributeDefinitions() == null) ? 0 : getAttributeDefinitions().hashCode()); hashCode = prime * hashCode + ((getTableName() == null) ? 0 : getTableName().hashCode()); hashCode = prime * hashCode + ((getBillingMode() == null) ? 0 : getBillingMode().hashCode()); hashCode = prime * hashCode + ((getProvisionedThroughput() == null) ? 0 : getProvisionedThroughput().hashCode()); hashCode = prime * hashCode + ((getGlobalSecondaryIndexUpdates() == null) ? 0 : getGlobalSecondaryIndexUpdates().hashCode()); hashCode = prime * hashCode + ((getStreamSpecification() == null) ? 0 : getStreamSpecification().hashCode()); hashCode = prime * hashCode + ((getSSESpecification() == null) ? 0 : getSSESpecification().hashCode()); return hashCode; }
if (other.getStreamSpecification() == null ^ this.getStreamSpecification() == null) return false; if (other.getStreamSpecification() != null && other.getStreamSpecification().equals(this.getStreamSpecification()) == false) return false; if (other.getSSESpecification() == null ^ this.getSSESpecification() == null)
/** * <p> * Indicates whether DynamoDB Streams is enabled (true) or disabled (false) on the table. * </p> * * @param streamEnabled * Indicates whether DynamoDB Streams is enabled (true) or disabled (false) on the table. * @return Returns a reference to this object so that method calls can be chained together. */ public StreamSpecification withStreamEnabled(Boolean streamEnabled) { setStreamEnabled(streamEnabled); return this; }
setStreamViewType(streamViewType); return this;
public static TableDescription createTable(AmazonDynamoDB client, String tableName) throws InterruptedException { CreateTableRequest tableReq = new CreateTableRequest().withTableName(tableName) .withKeySchema(new KeySchemaElement("Id", KeyType.HASH)) .withAttributeDefinitions(new AttributeDefinition("Id", ScalarAttributeType.N)) .withProvisionedThroughput(new ProvisionedThroughput(10L, 10L)) .withStreamSpecification(new StreamSpecification().withStreamEnabled(true).withStreamViewType(StreamViewType.NEW_AND_OLD_IMAGES)); DynamoDB dynamoDB = new DynamoDB(client); Table table = dynamoDB.createTable(tableReq); return table.waitForActive(); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAttributeDefinitions() == null) ? 0 : getAttributeDefinitions().hashCode()); hashCode = prime * hashCode + ((getTableName() == null) ? 0 : getTableName().hashCode()); hashCode = prime * hashCode + ((getKeySchema() == null) ? 0 : getKeySchema().hashCode()); hashCode = prime * hashCode + ((getLocalSecondaryIndexes() == null) ? 0 : getLocalSecondaryIndexes().hashCode()); hashCode = prime * hashCode + ((getGlobalSecondaryIndexes() == null) ? 0 : getGlobalSecondaryIndexes().hashCode()); hashCode = prime * hashCode + ((getBillingMode() == null) ? 0 : getBillingMode().hashCode()); hashCode = prime * hashCode + ((getProvisionedThroughput() == null) ? 0 : getProvisionedThroughput().hashCode()); hashCode = prime * hashCode + ((getStreamSpecification() == null) ? 0 : getStreamSpecification().hashCode()); hashCode = prime * hashCode + ((getSSESpecification() == null) ? 0 : getSSESpecification().hashCode()); return hashCode; }
if (other.getStreamDescription() == null ^ this.getStreamDescription() == null) return false; if (other.getStreamDescription() != null && other.getStreamDescription().equals(this.getStreamDescription()) == false) return false; if (other.getTimeToLiveDescription() == null ^ this.getTimeToLiveDescription() == null)
/** * <p> * Indicates whether DynamoDB Streams is enabled (true) or disabled (false) on the table. * </p> * * @param streamEnabled * Indicates whether DynamoDB Streams is enabled (true) or disabled (false) on the table. * @return Returns a reference to this object so that method calls can be chained together. */ public StreamSpecification withStreamEnabled(Boolean streamEnabled) { setStreamEnabled(streamEnabled); return this; }
setStreamViewType(streamViewType); return this;
public static TableDescription createTable(AmazonDynamoDB client, String tableName) throws InterruptedException { CreateTableRequest tableReq = new CreateTableRequest().withTableName(tableName) .withKeySchema(new KeySchemaElement("Id", KeyType.HASH)) .withAttributeDefinitions(new AttributeDefinition("Id", ScalarAttributeType.N)) .withProvisionedThroughput(new ProvisionedThroughput(10L, 10L)) .withStreamSpecification(new StreamSpecification().withStreamEnabled(true).withStreamViewType(StreamViewType.NEW_AND_OLD_IMAGES)); DynamoDB dynamoDB = new DynamoDB(client); Table table = dynamoDB.createTable(tableReq); return table.waitForActive(); }
public StreamSpecification unmarshall(JsonUnmarshallerContext context) throws Exception { AwsJsonReader reader = context.getReader(); if (!reader.isContainer()) { reader.skipValue(); return null; } StreamSpecification streamSpecification = new StreamSpecification(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("StreamEnabled")) { streamSpecification.setStreamEnabled(BooleanJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("StreamViewType")) { streamSpecification.setStreamViewType(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return streamSpecification; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof StreamSpecification == false) return false; StreamSpecification other = (StreamSpecification) obj; if (other.getStreamEnabled() == null ^ this.getStreamEnabled() == null) return false; if (other.getStreamEnabled() != null && other.getStreamEnabled().equals(this.getStreamEnabled()) == false) return false; if (other.getStreamViewType() == null ^ this.getStreamViewType() == null) return false; if (other.getStreamViewType() != null && other.getStreamViewType().equals(this.getStreamViewType()) == false) return false; return true; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getLocalSecondaryIndexes() == null) ? 0 : getLocalSecondaryIndexes().hashCode()); hashCode = prime * hashCode + ((getGlobalSecondaryIndexes() == null) ? 0 : getGlobalSecondaryIndexes().hashCode()); hashCode = prime * hashCode + ((getStreamDescription() == null) ? 0 : getStreamDescription().hashCode()); hashCode = prime * hashCode + ((getTimeToLiveDescription() == null) ? 0 : getTimeToLiveDescription().hashCode()); hashCode = prime * hashCode + ((getSSEDescription() == null) ? 0 : getSSEDescription().hashCode()); return hashCode; }
if (other.getStreamSpecification() == null ^ this.getStreamSpecification() == null) return false; if (other.getStreamSpecification() != null && other.getStreamSpecification().equals(this.getStreamSpecification()) == false) return false; if (other.getSSESpecification() == null ^ this.getSSESpecification() == null)
withStreamViewType(streamViewType);