setAttributeType(attributeType); return this;
/** * Constructs a new AttributeDefinition object. Callers should use the setter or fluent setter (with...) methods to * initialize any additional object members. * * @param attributeName * A name for the attribute. * @param attributeType * The data type for the attribute, where:</p> * <ul> * <li> * <p> * <code>S</code> - the attribute is of type String * </p> * </li> * <li> * <p> * <code>N</code> - the attribute is of type Number * </p> * </li> * <li> * <p> * <code>B</code> - the attribute is of type Binary * </p> * </li> */ public AttributeDefinition(String attributeName, String attributeType) { setAttributeName(attributeName); setAttributeType(attributeType); }
/** * Constructs a new AttributeDefinition object. Callers should use the setter or fluent setter (with...) methods to * initialize any additional object members. * * @param attributeName * A name for the attribute. * @param attributeType * The data type for the attribute, where:</p> * <ul> * <li> * <p> * <code>S</code> - the attribute is of type String * </p> * </li> * <li> * <p> * <code>N</code> - the attribute is of type Number * </p> * </li> * <li> * <p> * <code>B</code> - the attribute is of type Binary * </p> * </li> */ public AttributeDefinition(String attributeName, ScalarAttributeType attributeType) { setAttributeName(attributeName); setAttributeType(attributeType.toString()); }
attributeDefinition.setAttributeType(context.getUnmarshaller(String.class).unmarshall(context));
setAttributeType(attributeType);
setAttributeType(attributeType.toString());
public AttributeDefinition unmarshall(JsonUnmarshallerContext context) throws Exception { AwsJsonReader reader = context.getReader(); if (!reader.isContainer()) { reader.skipValue(); return null; } AttributeDefinition attributeDefinition = new AttributeDefinition(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("AttributeName")) { attributeDefinition.setAttributeName(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("AttributeType")) { attributeDefinition.setAttributeType(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return attributeDefinition; }
setAttributeType(attributeType); return this;
/** * Constructs a new AttributeDefinition object. Callers should use the setter or fluent setter (with...) methods to * initialize any additional object members. * * @param attributeName * A name for the attribute. * @param attributeType * The data type for the attribute, where:</p> * <ul> * <li> * <p> * <code>S</code> - the attribute is of type String * </p> * </li> * <li> * <p> * <code>N</code> - the attribute is of type Number * </p> * </li> * <li> * <p> * <code>B</code> - the attribute is of type Binary * </p> * </li> */ public AttributeDefinition(String attributeName, String attributeType) { setAttributeName(attributeName); setAttributeType(attributeType); }
/** * Constructs a new AttributeDefinition object. Callers should use the setter or fluent setter (with...) methods to * initialize any additional object members. * * @param attributeName * A name for the attribute. * @param attributeType * The data type for the attribute, where:</p> * <ul> * <li> * <p> * <code>S</code> - the attribute is of type String * </p> * </li> * <li> * <p> * <code>N</code> - the attribute is of type Number * </p> * </li> * <li> * <p> * <code>B</code> - the attribute is of type Binary * </p> * </li> */ public AttributeDefinition(String attributeName, ScalarAttributeType attributeType) { setAttributeName(attributeName); setAttributeType(attributeType.toString()); }
/** * Builds the necessary requests to create tables * * @param tableName * @param keySchema * @param proThrou * @param attrs * @return */ public static CreateTableRequest buildCreateTableRequest(String tableName, ArrayList<KeySchemaElement> keySchema, ProvisionedThroughput proThrou, Map<String, String> attrs) { CreateTableRequest createTableRequest = new CreateTableRequest(); createTableRequest.setTableName(tableName); createTableRequest.setKeySchema(keySchema); ArrayList<AttributeDefinition> attributeDefinitions = new ArrayList<AttributeDefinition>(); for (KeySchemaElement kEle : keySchema) { AttributeDefinition attrDef = new AttributeDefinition(); attrDef.setAttributeName(kEle.getAttributeName()); attrDef.setAttributeType(attrs.get(kEle.getAttributeName())); attributeDefinitions.add(attrDef); } createTableRequest.setAttributeDefinitions(attributeDefinitions); createTableRequest.setProvisionedThroughput(proThrou); return createTableRequest; }
attributeDefinition.setAttributeType(context.getUnmarshaller(String.class).unmarshall(context));