@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAttributeName() == null) ? 0 : getAttributeName().hashCode()); hashCode = prime * hashCode + ((getAttributeType() == null) ? 0 : getAttributeType().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AttributeDefinition == false) return false; AttributeDefinition other = (AttributeDefinition) obj; if (other.getAttributeName() == null ^ this.getAttributeName() == null) return false; if (other.getAttributeName() != null && other.getAttributeName().equals(this.getAttributeName()) == false) return false; if (other.getAttributeType() == null ^ this.getAttributeType() == null) return false; if (other.getAttributeType() != null && other.getAttributeType().equals(this.getAttributeType()) == 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 (getAttributeName() != null) sb.append("AttributeName: ").append(getAttributeName()).append(","); if (getAttributeType() != null) sb.append("AttributeType: ").append(getAttributeType()); sb.append("}"); return sb.toString(); }
/** * Marshall the given parameter object. */ public void marshall(AttributeDefinition attributeDefinition, ProtocolMarshaller protocolMarshaller) { if (attributeDefinition == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(attributeDefinition.getAttributeName(), ATTRIBUTENAME_BINDING); protocolMarshaller.marshall(attributeDefinition.getAttributeType(), ATTRIBUTETYPE_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 + ((getAttributeName() == null) ? 0 : getAttributeName().hashCode()); hashCode = prime * hashCode + ((getAttributeType() == null) ? 0 : getAttributeType().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 (getAttributeType() != null) sb.append("AttributeType: " + getAttributeType()); sb.append("}"); return sb.toString(); }
private static void putAfterCheckConflict(Map<String, AttributeDefinition> map, AttributeDefinition attrDefinition) { final String attrName = attrDefinition.getAttributeName(); final AttributeDefinition existingDefinition = map.get(attrName); if (existingDefinition != null && !existingDefinition.equals(attrDefinition)) { throw new DynamoDBMappingException( "Found conflicting definitions for attribute [" + attrName + "]: " + existingDefinition + " and " + attrDefinition + "."); } else { map.put(attrName, attrDefinition); } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AttributeDefinition == false) return false; AttributeDefinition other = (AttributeDefinition) obj; if (other.getAttributeName() == null ^ this.getAttributeName() == null) return false; if (other.getAttributeName() != null && other.getAttributeName().equals(this.getAttributeName()) == false) return false; if (other.getAttributeType() == null ^ this.getAttributeType() == null) return false; if (other.getAttributeType() != null && other.getAttributeType().equals(this.getAttributeType()) == false) return false; return true; } }
public void marshall(AttributeDefinition attributeDefinition, AwsJsonWriter jsonWriter) throws Exception { jsonWriter.beginObject(); if (attributeDefinition.getAttributeName() != null) { String attributeName = attributeDefinition.getAttributeName(); jsonWriter.name("AttributeName"); jsonWriter.value(attributeName); } if (attributeDefinition.getAttributeType() != null) { String attributeType = attributeDefinition.getAttributeType(); jsonWriter.name("AttributeType"); jsonWriter.value(attributeType); } jsonWriter.endObject(); }
final String keyName = element.getAttributeName(); for (final AttributeDefinition ad : this.tableDescription.getAttributeDefinitions()) { if (ad.getAttributeName().equals(keyName)) { final KeyDescription kd = new KeyDescription(); kd.setHash("HASH".equalsIgnoreCase(element.getKeyType()));
converter); createTableRequest.withKeySchema(new KeySchemaElement(pHashAttrDefinition .getAttributeName(), KeyType.HASH)); pRangeAttrDefinition = getKeyAttributeDefinition(pRangeKeyGetter, converter); createTableRequest.withKeySchema(new KeySchemaElement(pRangeAttrDefinition .getAttributeName(), KeyType.RANGE));
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAttributeName() == null) ? 0 : getAttributeName().hashCode()); hashCode = prime * hashCode + ((getAttributeType() == null) ? 0 : getAttributeType().hashCode()); return hashCode; }
@Override public int compare(AttributeDefinition arg0, AttributeDefinition arg1) { if(arg0 == null) return -1; if(arg1 == null) return 1; int comp = arg0.getAttributeName().compareTo(arg1.getAttributeName()); if(comp != 0) return comp; comp = arg0.getAttributeType().compareTo(arg1.getAttributeType()); return comp; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AttributeDefinition == false) return false; AttributeDefinition other = (AttributeDefinition) obj; if (other.getAttributeName() == null ^ this.getAttributeName() == null) return false; if (other.getAttributeName() != null && other.getAttributeName().equals(this.getAttributeName()) == false) return false; if (other.getAttributeType() == null ^ this.getAttributeType() == null) return false; if (other.getAttributeType() != null && other.getAttributeType().equals(this.getAttributeType()) == 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 (getAttributeName() != null) sb.append("AttributeName: ").append(getAttributeName()).append(","); if (getAttributeType() != null) sb.append("AttributeType: ").append(getAttributeType()); sb.append("}"); return sb.toString(); }
/** * Marshall the given parameter object. */ public void marshall(AttributeDefinition attributeDefinition, ProtocolMarshaller protocolMarshaller) { if (attributeDefinition == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(attributeDefinition.getAttributeName(), ATTRIBUTENAME_BINDING); protocolMarshaller.marshall(attributeDefinition.getAttributeType(), ATTRIBUTETYPE_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
final TableDescription description = table.describe(); System.out.println(description.getAttributeDefinitions()); final List<AttributeDefinition> tableAttributeDefinitions = description.getAttributeDefinitions(); for (GlobalSecondaryIndexDescription gsi : description .getGlobalSecondaryIndexes()) { System.out.println("IndexName: " + gsi.getIndexName()); for (KeySchemaElement keySchemaElement : gsi.getKeySchema()) { final String attrName = keySchemaElement.getAttributeName(); final AttributeDefinition attrDef = tableAttributeDefinitions.stream() .filter(ad -> ad.getAttributeName().equals(attrName)).findFirst() .orElseThrow(RuntimeException::new); System.out.println( "AttributeName: " + attrDef.getAttributeName() + ", AttributeType: " + attrDef.getAttributeType()); } }
String keyName = attributeDefinition.getAttributeName(); String columnName = dynamoKeyToColumnName(keyName); TableColumnType type = TableColumnType.text;
final String attributeName = attributeDefinition.getAttributeName(); MutableColumn column = (MutableColumn) table.getColumnByName(attributeName); if (column == null) {