@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getItem() == null) ? 0 : getItem().hashCode()); hashCode = prime * hashCode + ((getTableName() == null) ? 0 : getTableName().hashCode()); hashCode = prime * hashCode + ((getConditionExpression() == null) ? 0 : getConditionExpression().hashCode()); hashCode = prime * hashCode + ((getExpressionAttributeNames() == null) ? 0 : getExpressionAttributeNames().hashCode()); hashCode = prime * hashCode + ((getExpressionAttributeValues() == null) ? 0 : getExpressionAttributeValues().hashCode()); hashCode = prime * hashCode + ((getReturnValuesOnConditionCheckFailure() == null) ? 0 : getReturnValuesOnConditionCheckFailure().hashCode()); return hashCode; }
/** * <p> * A condition that must be satisfied in order for a conditional update to succeed. * </p> * * @param conditionExpression * A condition that must be satisfied in order for a conditional update to succeed. * @return Returns a reference to this object so that method calls can be chained together. */ public Put withConditionExpression(String conditionExpression) { setConditionExpression(conditionExpression); return this; }
public Put unmarshall(JsonUnmarshallerContext context) throws Exception { Put put = new Put(); if (context.testExpression("Item", targetDepth)) { context.nextToken(); put.setItem(new MapUnmarshaller<String, AttributeValue>(context.getUnmarshaller(String.class), AttributeValueJsonUnmarshaller.getInstance()) .unmarshall(context)); put.setTableName(context.getUnmarshaller(String.class).unmarshall(context)); put.setConditionExpression(context.getUnmarshaller(String.class).unmarshall(context)); put.setExpressionAttributeNames(new MapUnmarshaller<String, String>(context.getUnmarshaller(String.class), context .getUnmarshaller(String.class)).unmarshall(context)); put.setExpressionAttributeValues(new MapUnmarshaller<String, AttributeValue>(context.getUnmarshaller(String.class), AttributeValueJsonUnmarshaller.getInstance()).unmarshall(context)); put.setReturnValuesOnConditionCheckFailure(context.getUnmarshaller(String.class).unmarshall(context));
Put childTableEntry = new Put() .withTableName(childTableNamePrefix + i) .withItem(childTableItem) .withReturnValuesOnConditionCheckFailure(ReturnValuesOnConditionCheckFailure.ALL_OLD); writes.add(new TransactWriteItem().withPut(childTableEntry)); Put mainTableEntry = new Put() .withTableName(tableName) .withItem(mainTableItem) .withReturnValuesOnConditionCheckFailure(ReturnValuesOnConditionCheckFailure.ALL_OLD);
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getConditionCheck() == null) ? 0 : getConditionCheck().hashCode()); hashCode = prime * hashCode + ((getPut() == null) ? 0 : getPut().hashCode()); hashCode = prime * hashCode + ((getDelete() == null) ? 0 : getDelete().hashCode()); hashCode = prime * hashCode + ((getUpdate() == null) ? 0 : getUpdate().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof TransactWriteItem == false) return false; TransactWriteItem other = (TransactWriteItem) obj; if (other.getConditionCheck() == null ^ this.getConditionCheck() == null) return false; if (other.getConditionCheck() != null && other.getConditionCheck().equals(this.getConditionCheck()) == false) return false; if (other.getPut() == null ^ this.getPut() == null) return false; if (other.getPut() != null && other.getPut().equals(this.getPut()) == false) return false; if (other.getDelete() == null ^ this.getDelete() == null) return false; if (other.getDelete() != null && other.getDelete().equals(this.getDelete()) == false) return false; if (other.getUpdate() == null ^ this.getUpdate() == null) return false; if (other.getUpdate() != null && other.getUpdate().equals(this.getUpdate()) == false) return false; return true; }
public Put unmarshall(JsonUnmarshallerContext context) throws Exception { Put put = new Put(); if (context.testExpression("Item", targetDepth)) { context.nextToken(); put.setItem(new MapUnmarshaller<String, AttributeValue>(context.getUnmarshaller(String.class), AttributeValueJsonUnmarshaller.getInstance()) .unmarshall(context)); put.setTableName(context.getUnmarshaller(String.class).unmarshall(context)); put.setConditionExpression(context.getUnmarshaller(String.class).unmarshall(context)); put.setExpressionAttributeNames(new MapUnmarshaller<String, String>(context.getUnmarshaller(String.class), context .getUnmarshaller(String.class)).unmarshall(context)); put.setExpressionAttributeValues(new MapUnmarshaller<String, AttributeValue>(context.getUnmarshaller(String.class), AttributeValueJsonUnmarshaller.getInstance()).unmarshall(context)); put.setReturnValuesOnConditionCheckFailure(context.getUnmarshaller(String.class).unmarshall(context));
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getConditionCheck() == null) ? 0 : getConditionCheck().hashCode()); hashCode = prime * hashCode + ((getPut() == null) ? 0 : getPut().hashCode()); hashCode = prime * hashCode + ((getDelete() == null) ? 0 : getDelete().hashCode()); hashCode = prime * hashCode + ((getUpdate() == null) ? 0 : getUpdate().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof TransactWriteItem == false) return false; TransactWriteItem other = (TransactWriteItem) obj; if (other.getConditionCheck() == null ^ this.getConditionCheck() == null) return false; if (other.getConditionCheck() != null && other.getConditionCheck().equals(this.getConditionCheck()) == false) return false; if (other.getPut() == null ^ this.getPut() == null) return false; if (other.getPut() != null && other.getPut().equals(this.getPut()) == false) return false; if (other.getDelete() == null ^ this.getDelete() == null) return false; if (other.getDelete() != null && other.getDelete().equals(this.getDelete()) == false) return false; if (other.getUpdate() == null ^ this.getUpdate() == null) return false; if (other.getUpdate() != null && other.getUpdate().equals(this.getUpdate()) == false) return false; return true; }
return false; Put other = (Put) obj; if (other.getItem() == null ^ this.getItem() == null) return false; if (other.getItem() != null && other.getItem().equals(this.getItem()) == false) return false; if (other.getTableName() == null ^ this.getTableName() == null) return false; if (other.getTableName() != null && other.getTableName().equals(this.getTableName()) == false) return false; if (other.getConditionExpression() == null ^ this.getConditionExpression() == null) return false; if (other.getConditionExpression() != null && other.getConditionExpression().equals(this.getConditionExpression()) == false) return false; if (other.getExpressionAttributeNames() == null ^ this.getExpressionAttributeNames() == null) return false; if (other.getExpressionAttributeNames() != null && other.getExpressionAttributeNames().equals(this.getExpressionAttributeNames()) == false) return false; if (other.getExpressionAttributeValues() == null ^ this.getExpressionAttributeValues() == null) return false; if (other.getExpressionAttributeValues() != null && other.getExpressionAttributeValues().equals(this.getExpressionAttributeValues()) == false) return false; if (other.getReturnValuesOnConditionCheckFailure() == null ^ this.getReturnValuesOnConditionCheckFailure() == null) return false; if (other.getReturnValuesOnConditionCheckFailure() != null && other.getReturnValuesOnConditionCheckFailure().equals(this.getReturnValuesOnConditionCheckFailure()) == false) return false; return true;
/** * <p> * A condition that must be satisfied in order for a conditional update to succeed. * </p> * * @param conditionExpression * A condition that must be satisfied in order for a conditional update to succeed. * @return Returns a reference to this object so that method calls can be chained together. */ public Put withConditionExpression(String conditionExpression) { setConditionExpression(conditionExpression); return this; }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getItem() != null) sb.append("Item: ").append(getItem()).append(","); if (getTableName() != null) sb.append("TableName: ").append(getTableName()).append(","); if (getConditionExpression() != null) sb.append("ConditionExpression: ").append(getConditionExpression()).append(","); if (getExpressionAttributeNames() != null) sb.append("ExpressionAttributeNames: ").append(getExpressionAttributeNames()).append(","); if (getExpressionAttributeValues() != null) sb.append("ExpressionAttributeValues: ").append(getExpressionAttributeValues()).append(","); if (getReturnValuesOnConditionCheckFailure() != null) sb.append("ReturnValuesOnConditionCheckFailure: ").append(getReturnValuesOnConditionCheckFailure()); sb.append("}"); return sb.toString(); }
/** * Marshall the given parameter object. */ public void marshall(Put put, ProtocolMarshaller protocolMarshaller) { if (put == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(put.getItem(), ITEM_BINDING); protocolMarshaller.marshall(put.getTableName(), TABLENAME_BINDING); protocolMarshaller.marshall(put.getConditionExpression(), CONDITIONEXPRESSION_BINDING); protocolMarshaller.marshall(put.getExpressionAttributeNames(), EXPRESSIONATTRIBUTENAMES_BINDING); protocolMarshaller.marshall(put.getExpressionAttributeValues(), EXPRESSIONATTRIBUTEVALUES_BINDING); protocolMarshaller.marshall(put.getReturnValuesOnConditionCheckFailure(), RETURNVALUESONCONDITIONCHECKFAILURE_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getItem() == null) ? 0 : getItem().hashCode()); hashCode = prime * hashCode + ((getTableName() == null) ? 0 : getTableName().hashCode()); hashCode = prime * hashCode + ((getConditionExpression() == null) ? 0 : getConditionExpression().hashCode()); hashCode = prime * hashCode + ((getExpressionAttributeNames() == null) ? 0 : getExpressionAttributeNames().hashCode()); hashCode = prime * hashCode + ((getExpressionAttributeValues() == null) ? 0 : getExpressionAttributeValues().hashCode()); hashCode = prime * hashCode + ((getReturnValuesOnConditionCheckFailure() == null) ? 0 : getReturnValuesOnConditionCheckFailure().hashCode()); return hashCode; }
return false; Put other = (Put) obj; if (other.getItem() == null ^ this.getItem() == null) return false; if (other.getItem() != null && other.getItem().equals(this.getItem()) == false) return false; if (other.getTableName() == null ^ this.getTableName() == null) return false; if (other.getTableName() != null && other.getTableName().equals(this.getTableName()) == false) return false; if (other.getConditionExpression() == null ^ this.getConditionExpression() == null) return false; if (other.getConditionExpression() != null && other.getConditionExpression().equals(this.getConditionExpression()) == false) return false; if (other.getExpressionAttributeNames() == null ^ this.getExpressionAttributeNames() == null) return false; if (other.getExpressionAttributeNames() != null && other.getExpressionAttributeNames().equals(this.getExpressionAttributeNames()) == false) return false; if (other.getExpressionAttributeValues() == null ^ this.getExpressionAttributeValues() == null) return false; if (other.getExpressionAttributeValues() != null && other.getExpressionAttributeValues().equals(this.getExpressionAttributeValues()) == false) return false; if (other.getReturnValuesOnConditionCheckFailure() == null ^ this.getReturnValuesOnConditionCheckFailure() == null) return false; if (other.getReturnValuesOnConditionCheckFailure() != null && other.getReturnValuesOnConditionCheckFailure().equals(this.getReturnValuesOnConditionCheckFailure()) == false) return false; return true;
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getItem() != null) sb.append("Item: ").append(getItem()).append(","); if (getTableName() != null) sb.append("TableName: ").append(getTableName()).append(","); if (getConditionExpression() != null) sb.append("ConditionExpression: ").append(getConditionExpression()).append(","); if (getExpressionAttributeNames() != null) sb.append("ExpressionAttributeNames: ").append(getExpressionAttributeNames()).append(","); if (getExpressionAttributeValues() != null) sb.append("ExpressionAttributeValues: ").append(getExpressionAttributeValues()).append(","); if (getReturnValuesOnConditionCheckFailure() != null) sb.append("ReturnValuesOnConditionCheckFailure: ").append(getReturnValuesOnConditionCheckFailure()); sb.append("}"); return sb.toString(); }
/** * Marshall the given parameter object. */ public void marshall(Put put, ProtocolMarshaller protocolMarshaller) { if (put == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(put.getItem(), ITEM_BINDING); protocolMarshaller.marshall(put.getTableName(), TABLENAME_BINDING); protocolMarshaller.marshall(put.getConditionExpression(), CONDITIONEXPRESSION_BINDING); protocolMarshaller.marshall(put.getExpressionAttributeNames(), EXPRESSIONATTRIBUTENAMES_BINDING); protocolMarshaller.marshall(put.getExpressionAttributeValues(), EXPRESSIONATTRIBUTEVALUES_BINDING); protocolMarshaller.marshall(put.getReturnValuesOnConditionCheckFailure(), RETURNVALUESONCONDITIONCHECKFAILURE_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }