@Test public void getsConfigAsClass() throws IOException { JsonNode configNode = MAPPER.readTree("foo: bar"); SpiExtension metadata = new SpiExtension(new SpiExtensionFactory("factoryClass", "classPath"), configNode, null); TestObject config = metadata.config(TestObject.class); assertThat(config.foo, is("bar")); }
public JsonNode config() { return config; }
SpiExtension { public JsonNode config() { return config; } }
SpiExtension { public JsonNode config() { return config; } @JsonCreator  SpiExtension(@JsonProperty("factory") SpiExtensionFactory factory,
                        @JsonProperty("config") JsonNode config,
                        @JsonProperty("enabled") Boolean enabled); }
SpiExtension { public JsonNode config() { return config; } @JsonCreator  SpiExtension(@JsonProperty("factory") SpiExtensionFactory factory,
                        @JsonProperty("config") JsonNode config,
                        @JsonProperty("enabled") Boolean enabled); SpiExtensionFactory factory(); JsonNode config(); boolean enabled(); T config(Class<T> configClass); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
SpiExtension { public JsonNode config() { return config; } @JsonCreator  SpiExtension(@JsonProperty("factory") SpiExtensionFactory factory,
                        @JsonProperty("config") JsonNode config,
                        @JsonProperty("enabled") Boolean enabled); SpiExtensionFactory factory(); JsonNode config(); boolean enabled(); T config(Class<T> configClass); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }