if (getExpressionAttributeNames() != null) sb.append("ExpressionAttributeNames: ").append(getExpressionAttributeNames()).append(","); if (getExpressionAttributeValues() != null) sb.append("ExpressionAttributeValues: ").append(getExpressionAttributeValues()).append(","); if (getConsistentRead() != null) sb.append("ConsistentRead: ").append(getConsistentRead());
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTableName() == null) ? 0 : getTableName().hashCode()); hashCode = prime * hashCode + ((getIndexName() == null) ? 0 : getIndexName().hashCode()); hashCode = prime * hashCode + ((getAttributesToGet() == null) ? 0 : getAttributesToGet().hashCode()); hashCode = prime * hashCode + ((getLimit() == null) ? 0 : getLimit().hashCode()); hashCode = prime * hashCode + ((getSelect() == null) ? 0 : getSelect().hashCode()); hashCode = prime * hashCode + ((getScanFilter() == null) ? 0 : getScanFilter().hashCode()); hashCode = prime * hashCode + ((getConditionalOperator() == null) ? 0 : getConditionalOperator().hashCode()); hashCode = prime * hashCode + ((getExclusiveStartKey() == null) ? 0 : getExclusiveStartKey().hashCode()); hashCode = prime * hashCode + ((getReturnConsumedCapacity() == null) ? 0 : getReturnConsumedCapacity().hashCode()); hashCode = prime * hashCode + ((getTotalSegments() == null) ? 0 : getTotalSegments().hashCode()); hashCode = prime * hashCode + ((getSegment() == null) ? 0 : getSegment().hashCode()); hashCode = prime * hashCode + ((getProjectionExpression() == null) ? 0 : getProjectionExpression().hashCode()); hashCode = prime * hashCode + ((getFilterExpression() == null) ? 0 : getFilterExpression().hashCode()); hashCode = prime * hashCode + ((getExpressionAttributeNames() == null) ? 0 : getExpressionAttributeNames().hashCode()); hashCode = prime * hashCode + ((getExpressionAttributeValues() == null) ? 0 : getExpressionAttributeValues().hashCode()); hashCode = prime * hashCode + ((getConsistentRead() == null) ? 0 : getConsistentRead().hashCode()); return hashCode; }
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.getConsistentRead() == null ^ this.getConsistentRead() == null)
/** * Marshall the given parameter object. */ public void marshall(ScanRequest scanRequest, ProtocolMarshaller protocolMarshaller) { if (scanRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(scanRequest.getTableName(), TABLENAME_BINDING); protocolMarshaller.marshall(scanRequest.getIndexName(), INDEXNAME_BINDING); protocolMarshaller.marshall(scanRequest.getAttributesToGet(), ATTRIBUTESTOGET_BINDING); protocolMarshaller.marshall(scanRequest.getLimit(), LIMIT_BINDING); protocolMarshaller.marshall(scanRequest.getSelect(), SELECT_BINDING); protocolMarshaller.marshall(scanRequest.getScanFilter(), SCANFILTER_BINDING); protocolMarshaller.marshall(scanRequest.getConditionalOperator(), CONDITIONALOPERATOR_BINDING); protocolMarshaller.marshall(scanRequest.getExclusiveStartKey(), EXCLUSIVESTARTKEY_BINDING); protocolMarshaller.marshall(scanRequest.getReturnConsumedCapacity(), RETURNCONSUMEDCAPACITY_BINDING); protocolMarshaller.marshall(scanRequest.getTotalSegments(), TOTALSEGMENTS_BINDING); protocolMarshaller.marshall(scanRequest.getSegment(), SEGMENT_BINDING); protocolMarshaller.marshall(scanRequest.getProjectionExpression(), PROJECTIONEXPRESSION_BINDING); protocolMarshaller.marshall(scanRequest.getFilterExpression(), FILTEREXPRESSION_BINDING); protocolMarshaller.marshall(scanRequest.getExpressionAttributeNames(), EXPRESSIONATTRIBUTENAMES_BINDING); protocolMarshaller.marshall(scanRequest.getExpressionAttributeValues(), EXPRESSIONATTRIBUTEVALUES_BINDING); protocolMarshaller.marshall(scanRequest.getConsistentRead(), CONSISTENTREAD_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
if (getExpressionAttributeNames() != null) sb.append("ExpressionAttributeNames: " + getExpressionAttributeNames() + ","); if (getExpressionAttributeValues() != null) sb.append("ExpressionAttributeValues: " + getExpressionAttributeValues() + ","); if (getConsistentRead() != null) sb.append("ConsistentRead: " + getConsistentRead());
hashCode = prime + ((getExpressionAttributeValues() == null) ? 0 : getExpressionAttributeValues() .hashCode()); hashCode = prime * hashCode
&& 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.getConsistentRead() == null ^ this.getConsistentRead() == null)
if (scanRequest.getExpressionAttributeValues() != null) { java.util.Map<String, AttributeValue> expressionAttributeValues = scanRequest .getExpressionAttributeValues(); jsonWriter.name("ExpressionAttributeValues"); jsonWriter.beginObject();
@Test public void testCreateScanRequestFromExpression() { DynamoDBScanExpression se = new DynamoDBScanExpression(); se.setConditionalOperator("lt"); Map<String, AttributeValue> esk = new HashMap<String, AttributeValue>(); se.setExclusiveStartKey(esk); Map<String, String> ean = new HashMap<String, String>(); se.setExpressionAttributeNames(ean); Map<String, AttributeValue> eav = new HashMap<String, AttributeValue>(); se.setExpressionAttributeValues(eav); se.setFilterExpression("testFilter"); se.setLimit(5); Map<String, Condition> filter = new HashMap<String, Condition>(); se.setScanFilter(filter); se.setSegment(2); se.setTotalSegments(10); ScanRequest sr = mapper.createScanRequestFromExpression(MockTwoValuePlusVersionClass.class, se, config); assertEquals(sr.getConditionalOperator(), "lt"); assertEquals(sr.getTableName(), "aws-android-sdk-dynamodbmapper-test"); assertEquals(sr.getExclusiveStartKey(), esk); assertEquals(sr.getExpressionAttributeNames(), ean); assertEquals(sr.getExpressionAttributeValues(), eav); assertEquals(sr.getFilterExpression(), "testFilter"); assertEquals(sr.getLimit().intValue(), 5); assertEquals(sr.getScanFilter(), filter); assertEquals(sr.getSegment().intValue(), 2); assertEquals(sr.getTotalSegments().intValue(), 10); }
assertNull(sr1.getExclusiveStartKey()); assertEquals(sr1.getExpressionAttributeNames(), ean); assertEquals(sr1.getExpressionAttributeValues(), eav); assertEquals(sr1.getFilterExpression(), "testFilter"); assertEquals(sr1.getLimit().intValue(), 5); assertNull(sr2.getExclusiveStartKey()); assertEquals(sr2.getExpressionAttributeNames(), ean); assertEquals(sr2.getExpressionAttributeValues(), eav); assertEquals(sr2.getFilterExpression(), "testFilter"); assertEquals(sr2.getLimit().intValue(), 5);
if (getExpressionAttributeNames() != null) sb.append("ExpressionAttributeNames: ").append(getExpressionAttributeNames()).append(","); if (getExpressionAttributeValues() != null) sb.append("ExpressionAttributeValues: ").append(getExpressionAttributeValues()).append(","); if (getConsistentRead() != null) sb.append("ConsistentRead: ").append(getConsistentRead());
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getTableName() == null) ? 0 : getTableName().hashCode()); hashCode = prime * hashCode + ((getIndexName() == null) ? 0 : getIndexName().hashCode()); hashCode = prime * hashCode + ((getAttributesToGet() == null) ? 0 : getAttributesToGet().hashCode()); hashCode = prime * hashCode + ((getLimit() == null) ? 0 : getLimit().hashCode()); hashCode = prime * hashCode + ((getSelect() == null) ? 0 : getSelect().hashCode()); hashCode = prime * hashCode + ((getScanFilter() == null) ? 0 : getScanFilter().hashCode()); hashCode = prime * hashCode + ((getConditionalOperator() == null) ? 0 : getConditionalOperator().hashCode()); hashCode = prime * hashCode + ((getExclusiveStartKey() == null) ? 0 : getExclusiveStartKey().hashCode()); hashCode = prime * hashCode + ((getReturnConsumedCapacity() == null) ? 0 : getReturnConsumedCapacity().hashCode()); hashCode = prime * hashCode + ((getTotalSegments() == null) ? 0 : getTotalSegments().hashCode()); hashCode = prime * hashCode + ((getSegment() == null) ? 0 : getSegment().hashCode()); hashCode = prime * hashCode + ((getProjectionExpression() == null) ? 0 : getProjectionExpression().hashCode()); hashCode = prime * hashCode + ((getFilterExpression() == null) ? 0 : getFilterExpression().hashCode()); hashCode = prime * hashCode + ((getExpressionAttributeNames() == null) ? 0 : getExpressionAttributeNames().hashCode()); hashCode = prime * hashCode + ((getExpressionAttributeValues() == null) ? 0 : getExpressionAttributeValues().hashCode()); hashCode = prime * hashCode + ((getConsistentRead() == null) ? 0 : getConsistentRead().hashCode()); return hashCode; }
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.getConsistentRead() == null ^ this.getConsistentRead() == null)
/** * Marshall the given parameter object. */ public void marshall(ScanRequest scanRequest, ProtocolMarshaller protocolMarshaller) { if (scanRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(scanRequest.getTableName(), TABLENAME_BINDING); protocolMarshaller.marshall(scanRequest.getIndexName(), INDEXNAME_BINDING); protocolMarshaller.marshall(scanRequest.getAttributesToGet(), ATTRIBUTESTOGET_BINDING); protocolMarshaller.marshall(scanRequest.getLimit(), LIMIT_BINDING); protocolMarshaller.marshall(scanRequest.getSelect(), SELECT_BINDING); protocolMarshaller.marshall(scanRequest.getScanFilter(), SCANFILTER_BINDING); protocolMarshaller.marshall(scanRequest.getConditionalOperator(), CONDITIONALOPERATOR_BINDING); protocolMarshaller.marshall(scanRequest.getExclusiveStartKey(), EXCLUSIVESTARTKEY_BINDING); protocolMarshaller.marshall(scanRequest.getReturnConsumedCapacity(), RETURNCONSUMEDCAPACITY_BINDING); protocolMarshaller.marshall(scanRequest.getTotalSegments(), TOTALSEGMENTS_BINDING); protocolMarshaller.marshall(scanRequest.getSegment(), SEGMENT_BINDING); protocolMarshaller.marshall(scanRequest.getProjectionExpression(), PROJECTIONEXPRESSION_BINDING); protocolMarshaller.marshall(scanRequest.getFilterExpression(), FILTEREXPRESSION_BINDING); protocolMarshaller.marshall(scanRequest.getExpressionAttributeNames(), EXPRESSIONATTRIBUTENAMES_BINDING); protocolMarshaller.marshall(scanRequest.getExpressionAttributeValues(), EXPRESSIONATTRIBUTEVALUES_BINDING); protocolMarshaller.marshall(scanRequest.getConsistentRead(), CONSISTENTREAD_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
public static ScanRequest copyScanRequest(final ScanRequest request) { return new ScanRequest().withAttributesToGet(request.getAttributesToGet()) .withScanFilter(request.getScanFilter()) .withConditionalOperator(request.getConditionalOperator()) .withExclusiveStartKey(request.getExclusiveStartKey()) .withExpressionAttributeNames(request.getExpressionAttributeNames()) .withExpressionAttributeValues(cloneItem(request.getExpressionAttributeValues())) .withFilterExpression(request.getFilterExpression()) .withIndexName(request.getIndexName()).withLimit(request.getLimit()) .withProjectionExpression(request.getProjectionExpression()) .withReturnConsumedCapacity(request.getReturnConsumedCapacity()) .withScanFilter(request.getScanFilter()).withSelect(request.getSelect()) .withTableName(request.getTableName()).withTotalSegments(request.getTotalSegments()) .withSegment(request.getSegment()); }