public class ParameterUtils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
deserializeParametersFromJson(JIPipeParameterCollection target,
com.fasterxml.jackson.databind.JsonNode node,
JIPipeIssueReport issues)
Deserializes parameters from JSON
|
static <T> T |
getParameter(JIPipeParameterCollection collection,
String key,
Class<T> klass)
Gets a parameter from a
JIPipeParameterCollection |
static boolean |
isHiddenLocalParameter(JIPipeParameterTree tree,
JIPipeParameterAccess access,
String... keys)
Returns true if the provided parameter is local (i.e. only shown if its not a sub-parameter) and therefore should be hidden
|
static boolean |
isHiddenLocalParameterCollection(JIPipeParameterTree tree,
JIPipeParameterCollection collection,
String... keys)
Returns true if the collection is not a direct child of the tree root
|
static void |
serializeParametersToJson(JIPipeParameterCollection target,
com.fasterxml.jackson.core.JsonGenerator jsonGenerator)
Serializes parameters to JSON using a generator
|
static void |
serializeParametersToJson(JIPipeParameterCollection target,
com.fasterxml.jackson.core.JsonGenerator jsonGenerator,
Predicate<Map.Entry<String,JIPipeParameterAccess>> filter)
Serializes parameters to JSON using a generator
|
static boolean |
setParameter(JIPipeParameterCollection collection,
String key,
Object value)
Sets a parameter of a
JIPipeParameterCollection and triggers the associated events |
public static void deserializeParametersFromJson(JIPipeParameterCollection target, com.fasterxml.jackson.databind.JsonNode node, JIPipeIssueReport issues)
target
- the target object that contains the parametersnode
- the JSON nodeissues
- issues during deserializationpublic static void serializeParametersToJson(JIPipeParameterCollection target, com.fasterxml.jackson.core.JsonGenerator jsonGenerator) throws IOException
target
- the serialized parameter collectionjsonGenerator
- the JSON targetIOException
public static void serializeParametersToJson(JIPipeParameterCollection target, com.fasterxml.jackson.core.JsonGenerator jsonGenerator, Predicate<Map.Entry<String,JIPipeParameterAccess>> filter) throws IOException
target
- the serialized parameter collectionjsonGenerator
- the JSON targetfilter
- filter to conditionally serialize entries. can be nullIOException
public static boolean setParameter(JIPipeParameterCollection collection, String key, Object value)
JIPipeParameterCollection
and triggers the associated eventscollection
- the collectionkey
- the parameter keyvalue
- the parameter valuepublic static <T> T getParameter(JIPipeParameterCollection collection, String key, Class<T> klass)
JIPipeParameterCollection
T
- the parameter classcollection
- the collectionkey
- the parameter keyklass
- the parameter classpublic static boolean isHiddenLocalParameter(JIPipeParameterTree tree, JIPipeParameterAccess access, String... keys)
tree
- the parameter treeaccess
- the tested parameterkeys
- list of local parameter keys. only parameters in the key set are tested. If empty, all keys are testedpublic static boolean isHiddenLocalParameterCollection(JIPipeParameterTree tree, JIPipeParameterCollection collection, String... keys)
tree
- the parameter treecollection
- the collection to be testedkeys
- list of collection local keys. only collections with these keys are tested. If empty, all collections are tested.Copyright © 2020–2022 Leibniz Institute for Natural Product Research and Infection Biology - Hans Knöll Institute (HKI). All rights reserved.