if (getKey() != null) sb.append("Key: ").append(getKey()).append(","); if (getExpected() != null) sb.append("Expected: ").append(getExpected()).append(","); if (getConditionalOperator() != null) sb.append("ConditionalOperator: ").append(getConditionalOperator()).append(",");
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTableName() == null) ? 0 : getTableName().hashCode()); hashCode = prime * hashCode + ((getKey() == null) ? 0 : getKey().hashCode()); hashCode = prime * hashCode + ((getExpected() == null) ? 0 : getExpected().hashCode()); hashCode = prime * hashCode + ((getConditionalOperator() == null) ? 0 : getConditionalOperator().hashCode()); hashCode = prime * hashCode + ((getReturnValues() == null) ? 0 : getReturnValues().hashCode()); hashCode = prime * hashCode + ((getReturnConsumedCapacity() == null) ? 0 : getReturnConsumedCapacity().hashCode()); hashCode = prime * hashCode + ((getReturnItemCollectionMetrics() == null) ? 0 : getReturnItemCollectionMetrics().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()); return hashCode; }
if (other.getKey() != null && other.getKey().equals(this.getKey()) == false) return false; if (other.getExpected() == null ^ this.getExpected() == null) return false; if (other.getExpected() != null && other.getExpected().equals(this.getExpected()) == false) return false; if (other.getConditionalOperator() == null ^ this.getConditionalOperator() == null)
/** * Marshall the given parameter object. */ public void marshall(DeleteItemRequest deleteItemRequest, ProtocolMarshaller protocolMarshaller) { if (deleteItemRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(deleteItemRequest.getTableName(), TABLENAME_BINDING); protocolMarshaller.marshall(deleteItemRequest.getKey(), KEY_BINDING); protocolMarshaller.marshall(deleteItemRequest.getExpected(), EXPECTED_BINDING); protocolMarshaller.marshall(deleteItemRequest.getConditionalOperator(), CONDITIONALOPERATOR_BINDING); protocolMarshaller.marshall(deleteItemRequest.getReturnValues(), RETURNVALUES_BINDING); protocolMarshaller.marshall(deleteItemRequest.getReturnConsumedCapacity(), RETURNCONSUMEDCAPACITY_BINDING); protocolMarshaller.marshall(deleteItemRequest.getReturnItemCollectionMetrics(), RETURNITEMCOLLECTIONMETRICS_BINDING); protocolMarshaller.marshall(deleteItemRequest.getConditionExpression(), CONDITIONEXPRESSION_BINDING); protocolMarshaller.marshall(deleteItemRequest.getExpressionAttributeNames(), EXPRESSIONATTRIBUTENAMES_BINDING); protocolMarshaller.marshall(deleteItemRequest.getExpressionAttributeValues(), EXPRESSIONATTRIBUTEVALUES_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
if (getKey() != null) sb.append("Key: " + getKey() + ","); if (getExpected() != null) sb.append("Expected: " + getExpected() + ","); if (getConditionalOperator() != null) sb.append("ConditionalOperator: " + getConditionalOperator() + ",");
hashCode = prime * hashCode + ((getExpected() == null) ? 0 : getExpected().hashCode()); hashCode = prime * hashCode + ((getConditionalOperator() == null) ? 0 : getConditionalOperator().hashCode());
if (other.getKey() != null && other.getKey().equals(this.getKey()) == false) return false; if (other.getExpected() == null ^ this.getExpected() == null) return false; if (other.getExpected() != null && other.getExpected().equals(this.getExpected()) == false) return false; if (other.getConditionalOperator() == null ^ this.getConditionalOperator() == null)
if (deleteItemRequest.getExpected() != null) { java.util.Map<String, ExpectedAttributeValue> expected = deleteItemRequest .getExpected(); jsonWriter.name("Expected"); jsonWriter.beginObject();
if (getKey() != null) sb.append("Key: ").append(getKey()).append(","); if (getExpected() != null) sb.append("Expected: ").append(getExpected()).append(","); if (getConditionalOperator() != null) sb.append("ConditionalOperator: ").append(getConditionalOperator()).append(",");
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTableName() == null) ? 0 : getTableName().hashCode()); hashCode = prime * hashCode + ((getKey() == null) ? 0 : getKey().hashCode()); hashCode = prime * hashCode + ((getExpected() == null) ? 0 : getExpected().hashCode()); hashCode = prime * hashCode + ((getConditionalOperator() == null) ? 0 : getConditionalOperator().hashCode()); hashCode = prime * hashCode + ((getReturnValues() == null) ? 0 : getReturnValues().hashCode()); hashCode = prime * hashCode + ((getReturnConsumedCapacity() == null) ? 0 : getReturnConsumedCapacity().hashCode()); hashCode = prime * hashCode + ((getReturnItemCollectionMetrics() == null) ? 0 : getReturnItemCollectionMetrics().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()); return hashCode; }
@Override public DeleteItemResult deleteItem(DeleteItemRequest request) throws AmazonServiceException, AmazonClientException { Map<String, ExpectedAttributeValue> expectedValues = request.getExpected(); checkExpectedValues(request.getTableName(), request.getKey(), expectedValues); // conditional checks are handled by the above call request.setExpected(null); return txn.deleteItem(request); }
if (other.getKey() != null && other.getKey().equals(this.getKey()) == false) return false; if (other.getExpected() == null ^ this.getExpected() == null) return false; if (other.getExpected() != null && other.getExpected().equals(this.getExpected()) == false) return false; if (other.getConditionalOperator() == null ^ this.getConditionalOperator() == null)
/** * Marshall the given parameter object. */ public void marshall(DeleteItemRequest deleteItemRequest, ProtocolMarshaller protocolMarshaller) { if (deleteItemRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(deleteItemRequest.getTableName(), TABLENAME_BINDING); protocolMarshaller.marshall(deleteItemRequest.getKey(), KEY_BINDING); protocolMarshaller.marshall(deleteItemRequest.getExpected(), EXPECTED_BINDING); protocolMarshaller.marshall(deleteItemRequest.getConditionalOperator(), CONDITIONALOPERATOR_BINDING); protocolMarshaller.marshall(deleteItemRequest.getReturnValues(), RETURNVALUES_BINDING); protocolMarshaller.marshall(deleteItemRequest.getReturnConsumedCapacity(), RETURNCONSUMEDCAPACITY_BINDING); protocolMarshaller.marshall(deleteItemRequest.getReturnItemCollectionMetrics(), RETURNITEMCOLLECTIONMETRICS_BINDING); protocolMarshaller.marshall(deleteItemRequest.getConditionExpression(), CONDITIONEXPRESSION_BINDING); protocolMarshaller.marshall(deleteItemRequest.getExpressionAttributeNames(), EXPRESSIONATTRIBUTENAMES_BINDING); protocolMarshaller.marshall(deleteItemRequest.getExpressionAttributeValues(), EXPRESSIONATTRIBUTEVALUES_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
@Override protected void doValidate(String txId, TransactionManager txManager) { validateAttributes(this, request.getKey(), txId, txManager); if(request.getReturnConsumedCapacity() != null) { throw new InvalidRequestException("ReturnConsumedCapacity is not currently supported", txId, getTableName(), null, this); } if(request.getReturnItemCollectionMetrics() != null) { throw new InvalidRequestException("ReturnItemCollectionMetrics is not currently supported", txId, getTableName(), null, this); } if(request.getExpected() != null) { throw new InvalidRequestException("Requests with conditions are not currently supported", txId, getTableName(), getKey(txManager), this); } if(request.getConditionExpression() != null) { throw new InvalidRequestException("Requests with conditions are not currently supported", txId, getTableName(), getKey(txManager), this); } if(request.getExpressionAttributeNames() != null) { throw new InvalidRequestException("Requests with expressions are not currently supported", txId, getTableName(), getKey(txManager), this); } if(request.getExpressionAttributeValues() != null) { throw new InvalidRequestException("Requests with expressions are not currently supported", txId, getTableName(), getKey(txManager), this); } } }