public class EnvVarOperationProcessor extends Object
Constructor and Description |
---|
EnvVarOperationProcessor() |
Modifier and Type | Method and Description |
---|---|
static List<String> |
convertToList(String value,
String delimiter)
Converts a given value to string using a delimiter passed to this method
|
static String |
convertToString(List<String> list,
String delimiter)
Converts list to a single String using a given delimiter to separate
the list value in the resulting String
|
static IEnvironmentVariable[] |
filterVariables(IEnvironmentVariable[] variables,
String[] remove) |
static String |
normalizeName(String name)
normalizes the variable name.
|
static String |
performAppend(String initialValue,
String addValue,
String delimiter)
performs append given an initial String, a string to be appended and a delimiter
Returns a String representing the result of the operation
|
static String |
performAppendPrepend(String initialValue,
String addValue,
String delimiter,
boolean prepend)
performs append or prepend given an initial String, a string to be appended/prepended and a delimiter
Returns a String representing the result of the operation
|
static IEnvironmentVariable |
performOperation(IEnvironmentVariable initial,
IEnvironmentVariable added)
performs the environment variable operation given an initial variable and
a variable representing an operation to be performed
Returns a new variable the represents the result of a performed operation
|
static String |
performOperation(String initialValue,
String newValue,
String delimiter,
int op)
performs an environment variable operation
Returns String representing the result of the operation
|
static String |
performPrepend(String initialValue,
String addValue,
String delimiter)
performs prepend given an initial String, a string to be prepended and a delimiter
Returns a String representing the result of the operation
|
static List<String> |
removeDuplicates(List<String> value,
List<String> duplicates)
removes duplicates
|
public static IEnvironmentVariable performOperation(IEnvironmentVariable initial, IEnvironmentVariable added)
initial
- the initial variableadded
- the variable that specifies an operation to be performed on the
initial variable valuepublic static String performAppendPrepend(String initialValue, String addValue, String delimiter, boolean prepend)
initialValue
- addValue
- delimiter
- prepend
- public static String performAppend(String initialValue, String addValue, String delimiter)
initialValue
- addValue
- delimiter
- public static String performPrepend(String initialValue, String addValue, String delimiter)
initialValue
- addValue
- delimiter
- public static String performOperation(String initialValue, String newValue, String delimiter, int op)
initialValue
- newValue
- delimiter
- op
- public static List<String> convertToList(String value, String delimiter)
value
- delimiter
- public static List<String> removeDuplicates(List<String> value, List<String> duplicates)
public static String convertToString(List<String> list, String delimiter)
list
- delimiter
- public static String normalizeName(String name)
null
in case the name is not validpublic static IEnvironmentVariable[] filterVariables(IEnvironmentVariable[] variables, String[] remove)
Copyright (c) IBM Corp. and others 2004, 2020. All Rights Reserved.