if (getSelect() != null) sb.append("Select: ").append(getSelect()).append(","); if (getScanFilter() != null) sb.append("ScanFilter: ").append(getScanFilter()).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 + ((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.getSelect() != null && other.getSelect().equals(this.getSelect()) == false) return false; if (other.getScanFilter() == null ^ this.getScanFilter() == null) return false; if (other.getScanFilter() != null && other.getScanFilter().equals(this.getScanFilter()) == false) return false; if (other.getConditionalOperator() == null ^ this.getConditionalOperator() == 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 (getSelect() != null) sb.append("Select: " + getSelect() + ","); if (getScanFilter() != null) sb.append("ScanFilter: " + getScanFilter() + ","); if (getConditionalOperator() != null) sb.append("ConditionalOperator: " + getConditionalOperator() + ",");
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());
if (request.getScanFilter() != null && request.getScanFilter().size() > 1) { request.setConditionalOperator(this.conditionalOperator);
if (other.getSelect() != null && other.getSelect().equals(this.getSelect()) == false) return false; if (other.getScanFilter() == null ^ this.getScanFilter() == null) return false; if (other.getScanFilter() != null && other.getScanFilter().equals(this.getScanFilter()) == false) return false; if (other.getConditionalOperator() == null ^ this.getConditionalOperator() == null)
if (request.getScanFilter() != null && request.getScanFilter().size() > 1) { request.setConditionalOperator(this.conditionalOperator);
jsonWriter.value(select); if (scanRequest.getScanFilter() != null) { java.util.Map<String, Condition> scanFilter = scanRequest.getScanFilter(); jsonWriter.name("ScanFilter"); 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); }
assertEquals(sr1.getFilterExpression(), "testFilter"); assertEquals(sr1.getLimit().intValue(), 5); assertEquals(sr1.getScanFilter(), filter); assertEquals(sr1.getSegment().intValue(), 0); assertEquals(sr1.getTotalSegments().intValue(), 2); assertEquals(sr2.getFilterExpression(), "testFilter"); assertEquals(sr2.getLimit().intValue(), 5); assertEquals(sr2.getScanFilter(), filter); assertEquals(sr2.getSegment().intValue(), 1); assertEquals(sr2.getTotalSegments().intValue(), 2);
if (getSelect() != null) sb.append("Select: ").append(getSelect()).append(","); if (getScanFilter() != null) sb.append("ScanFilter: ").append(getScanFilter()).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 + ((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; }
rslt.getCount(), rqst.getTableName(), rqst.getScanFilter(), rslt.getLastEvaluatedKey(), new PrintableConsumedCapacity(
rslt.getCount(), rqst.getTableName(), rqst.getScanFilter(), rslt.getLastEvaluatedKey(), new PrintableConsumedCapacity(
if (other.getSelect() != null && other.getSelect().equals(this.getSelect()) == false) return false; if (other.getScanFilter() == null ^ this.getScanFilter() == null) return false; if (other.getScanFilter() != null && other.getScanFilter().equals(this.getScanFilter()) == false) return false; if (other.getConditionalOperator() == null ^ this.getConditionalOperator() == null)
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()); }
/** * 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); } }