@Test public void require_that_get_can_be_used_instead() { ConfigPayloadBuilder builder = new ConfigPayloadBuilder(); ConfigPayloadBuilder.Array array = builder.getArray("foo"); ConfigPayloadBuilder b1 = array.get(0); ConfigPayloadBuilder b2 = array.get(1); ConfigPayloadBuilder b3 = array.get(0); ConfigPayloadBuilder b4 = array.get(1); assertThat(b1, is(b3)); assertThat(b2, is(b4)); ConfigPayloadBuilder.Array array_indexed = builder.getArray("bar"); ConfigPayloadBuilder bi3 = array_indexed.set(3); ConfigPayloadBuilder bi1 = array_indexed.set(1); ConfigPayloadBuilder bi32 = array_indexed.get(3); ConfigPayloadBuilder bi12 = array_indexed.get(1); assertThat(bi12, is(bi1)); assertThat(bi32, is(bi3)); }
public Array getArray(String name) { Array a = arrayMap.get(name); if (a == null) { validateArray(name); a = new Array(configDefinition, name); arrayMap.put(name, a); } return a; }
ConfigPayloadBuilder { public Array getArray(String name) { Array a = arrayMap.get(name); if (a == null) { validateArray(name); a = new Array(configDefinition, name); arrayMap.put(name, a); } return a; } }
ConfigPayloadBuilder { public Array getArray(String name) { Array a = arrayMap.get(name); if (a == null) { validateArray(name); a = new Array(configDefinition, name); arrayMap.put(name, a); } return a; } ConfigPayloadBuilder();  ConfigPayloadBuilder(ConfigDefinition configDefinition); private  ConfigPayloadBuilder(String value); private  ConfigPayloadBuilder(ConfigDefinition configDefinition, String value); private  ConfigPayloadBuilder(ConfigPayloadBuilder other);  ConfigPayloadBuilder(ConfigPayload payload); }
ConfigPayloadBuilder { public Array getArray(String name) { Array a = arrayMap.get(name); if (a == null) { validateArray(name); a = new Array(configDefinition, name); arrayMap.put(name, a); } return a; } ConfigPayloadBuilder();  ConfigPayloadBuilder(ConfigDefinition configDefinition); private  ConfigPayloadBuilder(String value); private  ConfigPayloadBuilder(ConfigDefinition configDefinition, String value); private  ConfigPayloadBuilder(ConfigPayloadBuilder other);  ConfigPayloadBuilder(ConfigPayload payload); void setField(String name, String value); ConfigPayloadBuilder getObject(String name); Array getArray(String name); void resolve(Cursor parent); ConfigPayloadBuilder override(ConfigPayloadBuilder other); String getValue(); void setValue(String value); MapBuilder getMap(String name); ConfigDefinition getConfigDefinition(); }
ConfigPayloadBuilder { public Array getArray(String name) { Array a = arrayMap.get(name); if (a == null) { validateArray(name); a = new Array(configDefinition, name); arrayMap.put(name, a); } return a; } ConfigPayloadBuilder();  ConfigPayloadBuilder(ConfigDefinition configDefinition); private  ConfigPayloadBuilder(String value); private  ConfigPayloadBuilder(ConfigDefinition configDefinition, String value); private  ConfigPayloadBuilder(ConfigPayloadBuilder other);  ConfigPayloadBuilder(ConfigPayload payload); void setField(String name, String value); ConfigPayloadBuilder getObject(String name); Array getArray(String name); void resolve(Cursor parent); ConfigPayloadBuilder override(ConfigPayloadBuilder other); String getValue(); void setValue(String value); MapBuilder getMap(String name); ConfigDefinition getConfigDefinition();  }