@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAttributeName() == null) ? 0 : getAttributeName().hashCode()); hashCode = prime * hashCode + ((getKeyType() == null) ? 0 : getKeyType().hashCode()); return hashCode; }
/** * 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 (getAttributeName() != null) sb.append("AttributeName: ").append(getAttributeName()).append(","); if (getKeyType() != null) sb.append("KeyType: ").append(getKeyType()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof KeySchemaElement == false) return false; KeySchemaElement other = (KeySchemaElement) obj; if (other.getAttributeName() == null ^ this.getAttributeName() == null) return false; if (other.getAttributeName() != null && other.getAttributeName().equals(this.getAttributeName()) == false) return false; if (other.getKeyType() == null ^ this.getKeyType() == null) return false; if (other.getKeyType() != null && other.getKeyType().equals(this.getKeyType()) == false) return false; return true; }
/** * Marshall the given parameter object. */ public void marshall(KeySchemaElement keySchemaElement, ProtocolMarshaller protocolMarshaller) { if (keySchemaElement == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(keySchemaElement.getAttributeName(), ATTRIBUTENAME_BINDING); protocolMarshaller.marshall(keySchemaElement.getKeyType(), KEYTYPE_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
/** * Gets the global secondary index. * @param indexName The index name. * @return The global secondary index or null. */ public GlobalSecondaryIndex globalSecondaryIndex(final String indexName) { if (!globalSecondaryIndexes.containsKey(indexName)) { return null; } final GlobalSecondaryIndex gsi = globalSecondaryIndexes.get(indexName); final GlobalSecondaryIndex copy = new GlobalSecondaryIndex().withIndexName(gsi.getIndexName()); copy.withProjection(new Projection().withProjectionType(gsi.getProjection().getProjectionType())); for (final KeySchemaElement key : gsi.getKeySchema()) { copy.withKeySchema(new KeySchemaElement(key.getAttributeName(), key.getKeyType())); } return copy; }
/** * Gets the local secondary index by name. * @param indexNames The index name. * @return The local secondary index, or null. */ public LocalSecondaryIndex localSecondaryIndex(final String indexName) { if (!localSecondaryIndexes.containsKey(indexName)) { return null; } final LocalSecondaryIndex lsi = localSecondaryIndexes.get(indexName); final LocalSecondaryIndex copy = new LocalSecondaryIndex().withIndexName(lsi.getIndexName()); copy.withProjection(new Projection().withProjectionType(lsi.getProjection().getProjectionType())); for (final KeySchemaElement key : lsi.getKeySchema()) { copy.withKeySchema(new KeySchemaElement(key.getAttributeName(), key.getKeyType())); } return copy; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAttributeName() == null) ? 0 : getAttributeName().hashCode()); hashCode = prime * hashCode + ((getKeyType() == null) ? 0 : getKeyType().hashCode()); return hashCode; }
/** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getAttributeName() != null) sb.append("AttributeName: " + getAttributeName() + ","); if (getKeyType() != null) sb.append("KeyType: " + getKeyType()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof KeySchemaElement == false) return false; KeySchemaElement other = (KeySchemaElement) obj; if (other.getAttributeName() == null ^ this.getAttributeName() == null) return false; if (other.getAttributeName() != null && other.getAttributeName().equals(this.getAttributeName()) == false) return false; if (other.getKeyType() == null ^ this.getKeyType() == null) return false; if (other.getKeyType() != null && other.getKeyType().equals(this.getKeyType()) == false) return false; return true; } }
public void marshall(KeySchemaElement keySchemaElement, AwsJsonWriter jsonWriter) throws Exception { jsonWriter.beginObject(); if (keySchemaElement.getAttributeName() != null) { String attributeName = keySchemaElement.getAttributeName(); jsonWriter.name("AttributeName"); jsonWriter.value(attributeName); } if (keySchemaElement.getKeyType() != null) { String keyType = keySchemaElement.getKeyType(); jsonWriter.name("KeyType"); jsonWriter.value(keyType); } jsonWriter.endObject(); }
existingLsi.getKeySchema().get(1).getKeyType())) { throw new IllegalStateException( "Found invalid state of an existing LocalSecondaryIndex object " +
final String existingKeyType = existingKey.getKeyType();
if (ad.getAttributeName().equals(keyName)) { final KeyDescription kd = new KeyDescription(); kd.setHash("HASH".equalsIgnoreCase(element.getKeyType())); kd.setType(getType(ad.getAttributeType())); if (kd.isHash()) {
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAttributeName() == null) ? 0 : getAttributeName().hashCode()); hashCode = prime * hashCode + ((getKeyType() == null) ? 0 : getKeyType().hashCode()); return hashCode; }
/** * 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 (getAttributeName() != null) sb.append("AttributeName: ").append(getAttributeName()).append(","); if (getKeyType() != null) sb.append("KeyType: ").append(getKeyType()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof KeySchemaElement == false) return false; KeySchemaElement other = (KeySchemaElement) obj; if (other.getAttributeName() == null ^ this.getAttributeName() == null) return false; if (other.getAttributeName() != null && other.getAttributeName().equals(this.getAttributeName()) == false) return false; if (other.getKeyType() == null ^ this.getKeyType() == null) return false; if (other.getKeyType() != null && other.getKeyType().equals(this.getKeyType()) == false) return false; return true; }
/** * Marshall the given parameter object. */ public void marshall(KeySchemaElement keySchemaElement, ProtocolMarshaller protocolMarshaller) { if (keySchemaElement == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(keySchemaElement.getAttributeName(), ATTRIBUTENAME_BINDING); protocolMarshaller.marshall(keySchemaElement.getKeyType(), KEYTYPE_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
private void addColumnFromKeySchema(String indexName, List<KeySchemaElement> keySchema, MutableTable table, boolean primaryKey) { for (final KeySchemaElement keySchemaElement : keySchema) { final String attributeName = keySchemaElement.getAttributeName(); if (table.getColumnByName(attributeName) == null) { final String keyType = keySchemaElement.getKeyType(); final MutableColumn column = new MutableColumn(attributeName, table).setPrimaryKey(primaryKey); appendRemarks(column, indexName + " member ('" + keyType + "' type)"); table.addColumn(column); } } }
/** * Gets the local secondary index by name. * @param indexNames The index name. * @return The local secondary index, or null. */ public LocalSecondaryIndex localSecondaryIndex(final String indexName) { if (!localSecondaryIndexes.containsKey(indexName)) { return null; } final LocalSecondaryIndex lsi = localSecondaryIndexes.get(indexName); final LocalSecondaryIndex copy = new LocalSecondaryIndex().withIndexName(lsi.getIndexName()); copy.withProjection(new Projection().withProjectionType(lsi.getProjection().getProjectionType())); for (final KeySchemaElement key : lsi.getKeySchema()) { copy.withKeySchema(new KeySchemaElement(key.getAttributeName(), key.getKeyType())); } return copy; }
/** * Gets the global secondary index. * @param indexName The index name. * @return The global secondary index or null. */ public GlobalSecondaryIndex globalSecondaryIndex(final String indexName) { if (!globalSecondaryIndexes.containsKey(indexName)) { return null; } final GlobalSecondaryIndex gsi = globalSecondaryIndexes.get(indexName); final GlobalSecondaryIndex copy = new GlobalSecondaryIndex().withIndexName(gsi.getIndexName()); copy.withProjection(new Projection().withProjectionType(gsi.getProjection().getProjectionType())); for (final KeySchemaElement key : gsi.getKeySchema()) { copy.withKeySchema(new KeySchemaElement(key.getAttributeName(), key.getKeyType())); } return copy; }