@Test public void testAddNullAttribute() throws Exception { List<ReplaceableAttribute> attributes = new ArrayList<ReplaceableAttribute>(); simpleDBConnection.addAttribute("x", null, attributes); assertNull(attributes.get(0).getValue()); }
void addAttribute(String name, Object value, List<ReplaceableAttribute> attributes) { if (value != null && value.getClass().isArray()) { String[] values = (String[])value; for (int i = 0; i < values.length; i++) { addAttribute(name, values[i], attributes); } } else { ReplaceableAttribute attribute = new ReplaceableAttribute(); attribute.setName(name); attribute.setReplace(true); attribute.setValue((String)value); attributes.add(attribute); } }
SimpleDBConnectionImpl implements SimpleDBConnection { void addAttribute(String name, Object value, List<ReplaceableAttribute> attributes) { if (value != null && value.getClass().isArray()) { String[] values = (String[])value; for (int i = 0; i < values.length; i++) { addAttribute(name, values[i], attributes); } } else { ReplaceableAttribute attribute = new ReplaceableAttribute(); attribute.setName(name); attribute.setReplace(true); attribute.setValue((String)value); attributes.add(attribute); } } }
SimpleDBConnectionImpl implements SimpleDBConnection { void addAttribute(String name, Object value, List<ReplaceableAttribute> attributes) { if (value != null && value.getClass().isArray()) { String[] values = (String[])value; for (int i = 0; i < values.length; i++) { addAttribute(name, values[i], attributes); } } else { ReplaceableAttribute attribute = new ReplaceableAttribute(); attribute.setName(name); attribute.setReplace(true); attribute.setValue((String)value); attributes.add(attribute); } } SimpleDBConnectionImpl(AmazonSimpleDB amazonSimpleDBClient); }
SimpleDBConnectionImpl implements SimpleDBConnection { void addAttribute(String name, Object value, List<ReplaceableAttribute> attributes) { if (value != null && value.getClass().isArray()) { String[] values = (String[])value; for (int i = 0; i < values.length; i++) { addAttribute(name, values[i], attributes); } } else { ReplaceableAttribute attribute = new ReplaceableAttribute(); attribute.setName(name); attribute.setReplace(true); attribute.setValue((String)value); attributes.add(attribute); } } SimpleDBConnectionImpl(AmazonSimpleDB amazonSimpleDBClient); @Override void createDomain(String domainName); @Override void deleteDomain(String domainName); @Override List<String> getDomains(); @Override Set<SimpleDBAttribute> getAttributeNames(String domainName); @Override int performInsert(String domainName, List<Column> columns, Iterator<? extends List<?>> valueList); @Override SelectResult performSelect(String selectExpression, String nextToken); @Override int performUpdate(String domainName, Map<String, Object> updateAttributes, String selectExpression); @Override int performDelete(String domainName, String selectExpression); @Override void close(); }
SimpleDBConnectionImpl implements SimpleDBConnection { void addAttribute(String name, Object value, List<ReplaceableAttribute> attributes) { if (value != null && value.getClass().isArray()) { String[] values = (String[])value; for (int i = 0; i < values.length; i++) { addAttribute(name, values[i], attributes); } } else { ReplaceableAttribute attribute = new ReplaceableAttribute(); attribute.setName(name); attribute.setReplace(true); attribute.setValue((String)value); attributes.add(attribute); } } SimpleDBConnectionImpl(AmazonSimpleDB amazonSimpleDBClient); @Override void createDomain(String domainName); @Override void deleteDomain(String domainName); @Override List<String> getDomains(); @Override Set<SimpleDBAttribute> getAttributeNames(String domainName); @Override int performInsert(String domainName, List<Column> columns, Iterator<? extends List<?>> valueList); @Override SelectResult performSelect(String selectExpression, String nextToken); @Override int performUpdate(String domainName, Map<String, Object> updateAttributes, String selectExpression); @Override int performDelete(String domainName, String selectExpression); @Override void close();  }