@Test void multipleLoads() { ConfigMappingLoader.getImplementationClass(Server.class); ConfigMappingLoader.getImplementationClass(Server.class); SmallRyeConfig config = new SmallRyeConfigBuilder().withSources( KeyValuesConfigSource.config("server.host", "localhost", "server.port", "8080")) .withMapping(Server.class) .build(); Server server = config.getConfigMapping(Server.class); assertEquals("localhost", server.host()); assertEquals(8080, server.port()); }
@SuppressWarnings("unchecked") static <T> Class<? extends ConfigMappingObject> getImplementationClass(Class<T> type) { final ConfigMappingMetadata mappingMetadata = ConfigMappingInterface.getConfigurationInterface(type); return (Class<? extends ConfigMappingObject>) loadClass(type.getClassLoader(), mappingMetadata.getClassName(), mappingMetadata.getClassBytes()); }
ConfigMappingLoader { @SuppressWarnings("unchecked") static <T> Class<? extends ConfigMappingObject> getImplementationClass(Class<T> type) { final ConfigMappingMetadata mappingMetadata = ConfigMappingInterface.getConfigurationInterface(type); return (Class<? extends ConfigMappingObject>) loadClass(type.getClassLoader(), mappingMetadata.getClassName(), mappingMetadata.getClassBytes()); } }
ConfigMappingLoader { @SuppressWarnings("unchecked") static <T> Class<? extends ConfigMappingObject> getImplementationClass(Class<T> type) { final ConfigMappingMetadata mappingMetadata = ConfigMappingInterface.getConfigurationInterface(type); return (Class<? extends ConfigMappingObject>) loadClass(type.getClassLoader(), mappingMetadata.getClassName(), mappingMetadata.getClassBytes()); }  }
ConfigMappingLoader { @SuppressWarnings("unchecked") static <T> Class<? extends ConfigMappingObject> getImplementationClass(Class<T> type) { final ConfigMappingMetadata mappingMetadata = ConfigMappingInterface.getConfigurationInterface(type); return (Class<? extends ConfigMappingObject>) loadClass(type.getClassLoader(), mappingMetadata.getClassName(), mappingMetadata.getClassBytes()); }  static List<ConfigMappingMetadata> getConfigMappingsMetadata(Class<?> type); }
ConfigMappingLoader { @SuppressWarnings("unchecked") static <T> Class<? extends ConfigMappingObject> getImplementationClass(Class<T> type) { final ConfigMappingMetadata mappingMetadata = ConfigMappingInterface.getConfigurationInterface(type); return (Class<? extends ConfigMappingObject>) loadClass(type.getClassLoader(), mappingMetadata.getClassName(), mappingMetadata.getClassBytes()); }  static List<ConfigMappingMetadata> getConfigMappingsMetadata(Class<?> type);  }