Class ECtransSetup
java.lang.Object
ecmwf.common.ectrans.ECtransSetup
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionECtransSetup
(String moduleName) Instantiates a new ectrans setup.ECtransSetup
(String moduleName, String data, Pair<?>... parameters) Instantiates a new ectrans setup. -
Method Summary
Modifier and TypeMethodDescription<T> T
Evaluate the script.void
Evaluate the script.boolean
Check if the parameter exists in the current module.static boolean
Exists.boolean
get
(ECtransOptions option, boolean defaultValue) Gets the.int
get
(ECtransOptions option, int defaultValue) Gets the.long
get
(ECtransOptions option, long defaultValue) Gets the.get
(ECtransOptions option, ByteSize defaultValue) Gets the.get
(ECtransOptions option, String defaultValue) Gets the.get
(ECtransOptions option, Duration defaultValue) Gets the.get
(ECtransOptions option, Period defaultValue) Gets the.int
Gets the.Gets the.boolean
getBoolean
(ECtransOptions option) Gets the boolean.getBooleanList
(ECtransOptions option) Gets the list of booleans.getBooleanObject
(ECtransOptions option) Gets the boolean object.getByteSize
(ECtransOptions option) Gets the byte size.getByteSize
(String name) Gets byte size.getByteSize
(String name, ByteSize defaultValue) Gets byte size.getByteSize
(String moduleName, String name, ByteSize defaultValue) Gets byte size.getByteSizeList
(ECtransOptions option) Gets the list of byte sizes.getData()
Gets the data (sorted properties and script if engine exists).getDouble
(ECtransOptions option) Gets the double.getDoubleList
(ECtransOptions option) Gets the list of doubles.getDuration
(ECtransOptions option) Gets the.getDuration
(String name) Gets duration.getDuration
(String moduleName, String name, Duration defaultValue) Gets the duration.getDuration
(String name, Duration defaultValue) Gets duration.getInteger
(ECtransOptions option) Gets the integer.getIntegerList
(ECtransOptions option) Gets the lif of integers.String[]
Gets the list.getLong
(ECtransOptions option) Gets the long.getLongList
(ECtransOptions option) Gets the list of longs.Gets the module name.getOptionalBoolean
(ECtransOptions option) Gets the optional boolean.getOptionalByteSize
(ECtransOptions option) Gets the optional byte size.getOptionalDouble
(ECtransOptions option) Gets the optional double.getOptionalDuration
(ECtransOptions option) Gets the optional duration.getOptionalInteger
(ECtransOptions option) Gets the optional integer.getOptionalLong
(ECtransOptions option) Gets the optional long.getOptionalPeriod
(ECtransOptions option) Gets the optional period.getOptionalString
(ECtransOptions option) Gets the optional string.getOptionalTimeRange
(ECtransOptions option) Gets the optional time range.getOptions
(ECtransOptions option) Gets the.getOptions
(ECtransOptions option, String delimiters) Gets the.getOptions
(ECtransOptions option, String key, String delimiters) Gets the.getOptions
(String name, String key, String delimiters) Gets the.getPeriod
(ECtransOptions option) Gets the.Gets the period.Gets the period.Gets the period.getProperties
(boolean secured) Gets the sorted properties.Gets the script if the engine exists.getString
(ECtransOptions option) Gets the string.getStringList
(ECtransOptions option) Gets list of strings.getTimeRange
(ECtransOptions option) Gets the time range.getTimeRangeList
(ECtransOptions option) Gets the list of time ranges.boolean
matches
(ECtransOptions options, String value) Matches.boolean
matches
(ECtransOptions option, String value, String defaultRegex) Matches.boolean
Matches.remove
(ECtransOptions option) Removes the.Removes the.void
removeAll
(ECtransGroups.Module module) Removes all parameters for the specified module name.void
Removes all parameters for the specified module name.Allow getting a new instance with the added parameters provided.void
set
(ECtransOptions option, boolean value) Sets the.void
set
(ECtransOptions option, double value) Sets the.void
set
(ECtransOptions option, int value) Sets the.void
set
(ECtransOptions option, long value) Sets the.void
set
(ECtransOptions option, ByteSize value) Sets the.void
set
(ECtransOptions option, String value) Sets the.void
Sets the double.void
Sets the int.void
Allow setting the aliases.void
setBooleanIfPresent
(ECtransOptions option, Consumer<? super Boolean> action) Sets the optional boolean if present.void
setByteSizeIfPresent
(ECtransOptions option, Consumer<? super ByteSize> action) Sets the optional byte size if present.void
Sets the data.void
setDoubleIfPresent
(ECtransOptions option, Consumer<? super Double> action) Sets the optional double if present.void
setDurationIfPresent
(ECtransOptions option, Consumer<? super Duration> action) Sets the optional duration if present.void
setIntegerIfPresent
(ECtransOptions option, Consumer<? super Integer> action) Sets the optional integer if present.void
setLongIfPresent
(ECtransOptions option, Consumer<? super Long> action) Sets the optional long if present.void
setPeriodIfPresent
(ECtransOptions option, Consumer<? super Period> action) Sets the optional period if present.void
setStringIfPresent
(ECtransOptions option, Consumer<? super String> action) Sets the optional string if present.void
setTimeRangeIfPresent
(ECtransOptions option, Consumer<? super TimeRange> action) Sets the optional time range if present.void
standardize
(ECtransOptions option, boolean removeIfSameAsDefault) Normalize the representation of the data and remove option with same value as default value if required.
-
Field Details
-
SEPARATOR
-
-
Constructor Details
-
ECtransSetup
Instantiates a new ectrans setup.- Parameters:
moduleName
- the module name
-
ECtransSetup
-
-
Method Details
-
replace
Allow getting a new instance with the added parameters provided.- Parameters:
parameters
- the parameters- Returns:
- the ectrans setup
-
setData
-
remove
-
remove
Removes the.- Parameters:
option
- the option- Returns:
- the string
-
removeAll
Removes all parameters for the specified module name. This is used to clean a host.- Parameters:
moduleName
- the module name
-
removeAll
Removes all parameters for the specified module name. This is used to clean a host.- Parameters:
module
- the module
-
matches
-
matches
Matches.- Parameters:
options
- the optionsvalue
- the value- Returns:
- true, if successful
-
matches
Matches.- Parameters:
option
- the optionvalue
- the valuedefaultRegex
- the default regex- Returns:
- true, if successful
-
get
-
get
Gets the.- Parameters:
option
- the optiondefaultValue
- the default value- Returns:
- the string
-
getDuration
Gets the.- Parameters:
option
- the option- Returns:
- the duration
-
get
Gets the.- Parameters:
option
- the optiondefaultValue
- the default value- Returns:
- the duration
-
getPeriod
Gets the.- Parameters:
option
- the option- Returns:
- the period
-
get
Gets the.- Parameters:
option
- the optiondefaultValue
- the default value- Returns:
- the period
-
get
Gets the.- Parameters:
option
- the optiondefaultValue
- the default value- Returns:
- the byte size
-
getList
-
getOptions
Gets the.- Parameters:
option
- the option- Returns:
- the options
-
getOptions
Gets the.- Parameters:
option
- the optiondelimiters
- the delimiters- Returns:
- the options
-
getOptions
Gets the.- Parameters:
option
- the optionkey
- the keydelimiters
- the delimiters- Returns:
- the options
-
getOptions
-
getDuration
-
getDuration
-
getDuration
-
getPeriod
-
getPeriod
-
getPeriod
-
getByteSize
-
getByteSize
-
getByteSize
-
getBooleanList
Gets the list of booleans.- Parameters:
option
- the option- Returns:
- the list of booleans
-
getBoolean
Gets the boolean.- Parameters:
option
- the option- Returns:
- the object of type class
-
getBooleanObject
Gets the boolean object.- Parameters:
option
- the option- Returns:
- the object of type class
-
getOptionalBoolean
Gets the optional boolean.- Parameters:
option
- the option- Returns:
- the object of type class
-
setBooleanIfPresent
Sets the optional boolean if present.- Parameters:
option
- the optionaction
- the action
-
getStringList
Gets list of strings.- Parameters:
option
- the option- Returns:
- the list of strings
-
getString
Gets the string.- Parameters:
option
- the option- Returns:
- the object of type class
-
getOptionalString
Gets the optional string.- Parameters:
option
- the option- Returns:
- the object of type class
-
setStringIfPresent
Sets the optional string if present.- Parameters:
option
- the optionaction
- the action
-
getIntegerList
Gets the lif of integers.- Parameters:
option
- the option- Returns:
- the list of integers
-
getInteger
Gets the integer.- Parameters:
option
- the option- Returns:
- the object of type class
-
getOptionalInteger
Gets the optional integer.- Parameters:
option
- the option- Returns:
- the object of type class
-
setIntegerIfPresent
Sets the optional integer if present.- Parameters:
option
- the optionaction
- the action
-
getLongList
Gets the list of longs.- Parameters:
option
- the option- Returns:
- the list of longs
-
getLong
Gets the long.- Parameters:
option
- the option- Returns:
- the object of type class
-
getOptionalLong
Gets the optional long.- Parameters:
option
- the option- Returns:
- the object of type class
-
setLongIfPresent
Sets the optional long if present.- Parameters:
option
- the optionaction
- the action
-
getDoubleList
Gets the list of doubles.- Parameters:
option
- the option- Returns:
- the list of doubles
-
getDouble
Gets the double.- Parameters:
option
- the option- Returns:
- the object of type class
-
getOptionalDouble
Gets the optional double.- Parameters:
option
- the option- Returns:
- the object of type class
-
setDoubleIfPresent
Sets the optional double if present.- Parameters:
option
- the optionaction
- the action
-
getByteSizeList
Gets the list of byte sizes.- Parameters:
option
- the option- Returns:
- the list of byte sizes
-
getByteSize
Gets the byte size.- Parameters:
option
- the option- Returns:
- the object of type class
-
getOptionalByteSize
Gets the optional byte size.- Parameters:
option
- the option- Returns:
- the object of type class
-
setByteSizeIfPresent
Sets the optional byte size if present.- Parameters:
option
- the optionaction
- the action
-
getOptionalDuration
Gets the optional duration.- Parameters:
option
- the option- Returns:
- the object of type class
-
setDurationIfPresent
Sets the optional duration if present.- Parameters:
option
- the optionaction
- the action
-
getOptionalPeriod
Gets the optional period.- Parameters:
option
- the option- Returns:
- the object of type class
-
setPeriodIfPresent
Sets the optional period if present.- Parameters:
option
- the optionaction
- the action
-
getTimeRangeList
Gets the list of time ranges.- Parameters:
option
- the option- Returns:
- the list of time ranges
-
getTimeRange
Gets the time range.- Parameters:
option
- the option- Returns:
- the time range
-
getOptionalTimeRange
Gets the optional time range.- Parameters:
option
- the option- Returns:
- the object of type class
-
setTimeRangeIfPresent
Sets the optional time range if present.- Parameters:
option
- the optionaction
- the action
-
exists
-
get
Gets the.- Parameters:
option
- the optiondefaultValue
- the default value- Returns:
- the true, if successful
-
get
Gets the.- Parameters:
option
- the optiondefaultValue
- the default value- Returns:
- the result
-
get
Gets the.- Parameters:
option
- the optiondefaultValue
- the default value- Returns:
- the result
-
exists
Check if the parameter exists in the current module. If the parameter is related to a function then the function is not executed.- Parameters:
name
- the name- Returns:
- true, if exists
-
set
Sets the.- Parameters:
option
- the optionvalue
- the value
-
set
Sets the.- Parameters:
option
- the optionvalue
- the value
-
set
Sets the.- Parameters:
option
- the optionvalue
- the value
-
set
Sets the.- Parameters:
option
- the optionvalue
- the value
-
set
Sets the.- Parameters:
option
- the optionvalue
- the value
-
set
Sets the.- Parameters:
option
- the optionvalue
- the value
-
set
-
set
-
set
Sets the double.- Parameters:
name
- the namevalue
- the value
-
standardize
Normalize the representation of the data and remove option with same value as default value if required.- Parameters:
option
- the optionremoveIfSameAsDefault
- remove if same as default value
-
getProperties
Gets the sorted properties.- Parameters:
secured
- if true then the private fields are hidden- Returns:
- the script
-
getScript
-
getData
Gets the data (sorted properties and script if engine exists).- Returns:
- the data
-
eval
Evaluate the script. The result is expected to be of the class clazz.- Type Parameters:
T
- the generic type- Parameters:
clazz
- the object class expectedscript
- the name of the function- Returns:
- the result of the function execution
- Throws:
ScriptException
- the script exception
-
eval
Evaluate the script. No return is expected from the function (void).- Parameters:
script
- the name of the function- Throws:
ScriptException
- the script exception
-
get
Gets the.- Parameters:
name
- the namedefaultValue
- the default value- Returns:
- the int
-
getModuleName
-