@Test public void test_map_of_struct() { Slime slime = new Slime(); Cursor map = slime.setObject().setObject("innermap"); map.setObject("one").setLong("foo", 1); map.setObject("two").setLong("foo", 2); MaptypesConfig config = new ConfigPayload(slime).toInstance(MaptypesConfig.class, ""); assertThat(config.innermap("one").foo(), is(1)); assertThat(config.innermap("two").foo(), is(2)); }
public <ConfigType extends ConfigInstance> ConfigType toInstance(Class<ConfigType> clazz, String configId) { return ConfigInstanceUtil.getNewInstance(clazz, configId, this); }
ConfigPayload { public <ConfigType extends ConfigInstance> ConfigType toInstance(Class<ConfigType> clazz, String configId) { return ConfigInstanceUtil.getNewInstance(clazz, configId, this); } }
ConfigPayload { public <ConfigType extends ConfigInstance> ConfigType toInstance(Class<ConfigType> clazz, String configId) { return ConfigInstanceUtil.getNewInstance(clazz, configId, this); } ConfigPayload(Slime slime); }
ConfigPayload { public <ConfigType extends ConfigInstance> ConfigType toInstance(Class<ConfigType> clazz, String configId) { return ConfigInstanceUtil.getNewInstance(clazz, configId, this); } ConfigPayload(Slime slime); static ConfigPayload fromInstance(ConfigInstance instance); static ConfigPayload fromBuilder(ConfigPayloadBuilder builder); Slime getSlime(); void serialize(OutputStream os, SlimeFormat format); @Override String toString(); String toString(boolean compact); ConfigPayload applyDefaultsFromDef(InnerCNode clientDef); static ConfigPayload empty(); static ConfigPayload fromString(String jsonString); boolean isEmpty(); Utf8Array toUtf8Array(boolean compact); static ConfigPayload fromUtf8Array(Utf8Array payload); ConfigType toInstance(Class<ConfigType> clazz, String configId); }
ConfigPayload { public <ConfigType extends ConfigInstance> ConfigType toInstance(Class<ConfigType> clazz, String configId) { return ConfigInstanceUtil.getNewInstance(clazz, configId, this); } ConfigPayload(Slime slime); static ConfigPayload fromInstance(ConfigInstance instance); static ConfigPayload fromBuilder(ConfigPayloadBuilder builder); Slime getSlime(); void serialize(OutputStream os, SlimeFormat format); @Override String toString(); String toString(boolean compact); ConfigPayload applyDefaultsFromDef(InnerCNode clientDef); static ConfigPayload empty(); static ConfigPayload fromString(String jsonString); boolean isEmpty(); Utf8Array toUtf8Array(boolean compact); static ConfigPayload fromUtf8Array(Utf8Array payload); ConfigType toInstance(Class<ConfigType> clazz, String configId);  }