public class PulsarConfigurationLoader extends Object
| Constructor and Description |
|---|
PulsarConfigurationLoader() |
| Modifier and Type | Method and Description |
|---|---|
static ServiceConfiguration |
convertFrom(PulsarConfiguration conf) |
static ServiceConfiguration |
convertFrom(PulsarConfiguration conf,
boolean ignoreNonExistMember)
Converts a PulsarConfiguration object to a ServiceConfiguration object.
|
static <T extends PulsarConfiguration> |
create(InputStream inStream,
Class<? extends PulsarConfiguration> clazz)
Creates PulsarConfiguration and loads it with populated attribute values loaded from provided inputstream
property file.
|
static <T extends PulsarConfiguration> |
create(Properties properties,
Class<? extends PulsarConfiguration> clazz)
Creates PulsarConfiguration and loads it with populated attribute values from provided Properties object.
|
static <T extends PulsarConfiguration> |
create(String configFile,
Class<? extends PulsarConfiguration> clazz)
Creates PulsarConfiguration and loads it with populated attribute values loaded from provided property file.
|
static boolean |
isComplete(Object obj)
Validates
FieldContext annotation on each field of the class element. |
public static <T extends PulsarConfiguration> T create(String configFile, Class<? extends PulsarConfiguration> clazz) throws IOException, IllegalArgumentException
configFile - IOExceptionIllegalArgumentExceptionpublic static <T extends PulsarConfiguration> T create(InputStream inStream, Class<? extends PulsarConfiguration> clazz) throws IOException, IllegalArgumentException
inStream - IOException - if an error occurred when reading from the input stream.IllegalArgumentException - if the input stream contains incorrect value typepublic static <T extends PulsarConfiguration> T create(Properties properties, Class<? extends PulsarConfiguration> clazz) throws IOException, IllegalArgumentException
properties - The properties to populate the attributed fromIOExceptionIllegalArgumentExceptionpublic static boolean isComplete(Object obj) throws IllegalArgumentException
FieldContext annotation on each field of the class element. If element is annotated required
and value of the element is null or number value is not in a provided (min,max) range then consider as incomplete
object and throws exception with incomplete parametersobj - IllegalArgumentException - if object is field values are not completed according to FieldContext constraints.IllegalAccessExceptionpublic static ServiceConfiguration convertFrom(PulsarConfiguration conf, boolean ignoreNonExistMember) throws RuntimeException
conf - ignoreNonExistMember - IllegalArgumentException - if conf has the field whose name is not contained in ServiceConfiguration and ignoreNonExistMember
is false.RuntimeExceptionpublic static ServiceConfiguration convertFrom(PulsarConfiguration conf) throws RuntimeException
RuntimeExceptionCopyright © 2017–2022 Apache Software Foundation. All rights reserved.