public class ParamUtils extends Object
Constructor and Description |
---|
ParamUtils() |
Modifier and Type | Method and Description |
---|---|
static List<Param<?>> |
getPublicFinalParamFields(Object object)
Finds all public final fields of the Param class type of the given object, including those
fields inherited from its interfaces and super-classes, and returns those Param instances as
a list.
|
static void |
initializeMapWithDefaultValues(Map<Param<?>,Object> paramMap,
WithParams<?> instance)
Updates the paramMap with default values of all public final Param-typed fields of the given
instance.
|
static <T extends WithParams<T>> |
instantiateWithParams(Map<String,?> jsonMap)
Instantiates a WithParams subclass from the provided json map.
|
static <T> void |
setParam(WithParams<?> instance,
Param<T> param,
Object value) |
static void |
updateExistingParams(WithParams<?> instance,
Map<Param<?>,Object> paramOverrides) |
public static void initializeMapWithDefaultValues(Map<Param<?>,Object> paramMap, WithParams<?> instance)
Note: This method should be called after all public final Param-typed fields of the given instance have been defined. A good choice is to call this method in the constructor of the given instance.
public static List<Param<?>> getPublicFinalParamFields(Object object)
object
- the object whose public final Param-typed fields will be returned.public static <T> void setParam(WithParams<?> instance, Param<T> param, Object value)
public static void updateExistingParams(WithParams<?> instance, Map<Param<?>,Object> paramOverrides)
public static <T extends WithParams<T>> T instantiateWithParams(Map<String,?> jsonMap) throws ClassNotFoundException, IOException
jsonMap
- a map containing className and paramMap.ClassNotFoundException
IOException
Copyright © 2019–2023 The Apache Software Foundation. All rights reserved.