Package csw.params.core.generics
Class ParameterSetType<T extends ParameterSetType<T>>
java.lang.Object
csw.params.core.generics.ParameterSetType<T>
- Type Parameters:
T
- the subclass of ParameterSetType
- Direct Known Subclasses:
CurrentState
,DemandState
,Observe
,ObserveEvent
,Result
,Setup
,SystemEvent
,Wait
The base trait for various parameter set types (commands or events)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadd
(P parameter) Adds a parameter to the parameter setfinal <S> Parameter<S>
Return the parameter associated with a Key rather than an Optionboolean
Returns true if the data contains the given keyprotected abstract T
Method called by subclass to create a copy with the same key (or other fields) and new parameters.protected String
A comma separated string representation of parameters<S> boolean
Returns true if the key exists in the parameter set<S> scala.Option<Parameter<S>>
Find a parameter based on it's keyName and keyType<S> scala.Option<Parameter<S>>
Returns an Option with the parameter for the key if found, otherwise None<S> scala.Option<Parameter<S>>
Returns an Option with the parameter for the key if found, otherwise NoneReturns a map based on this object where the keys and values are in string get (Could be useful for exporting in a get that other languages can read).A Java helper to find a parameter based on it's keyName and keyTypeReturns an Optional with the parameter for the key if found, otherwise emptyReturns an Optional with the parameter for the key if found, otherwise emptyA Java helper that returns a map based on this object where the keys and values are in string get (Could be useful for exporting in a get that other languages can read).jMissingKeys
(Key<?>... keys) A Java helper that returns a set containing the names of any of the given keys that are missing in the datajMissingKeys
(scala.collection.immutable.Seq<Key<?>> keys) A Java helper that returns a set containing the names of any of the given keys that are missing in the dataA Java helper to get parameters for this parameter setmadd
(P... parametersToAdd) Adds several parameters to the parameter setmadd
(scala.collection.immutable.Seq<P> parametersToAdd) Adds several parameters to the parameter setmadd
(scala.collection.immutable.Set<P> parametersToAdd) Adds several parameters to the parameter setscala.collection.immutable.Set<String>
missingKeys
(scala.collection.immutable.Seq<Key<?>> keys) Returns a set containing the names of any of the given keys that are missing in the datafinal <S> Parameter<S>
Returns the actual parameter associated with a keyabstract scala.collection.immutable.Set<Parameter<?>>
paramSet()
Holds the parameters for this parameter set<S> T
Remove a parameter from the parameter set by keyremove
(P parameter) Removes a parameter based on the parameterint
size()
The number of parameters in this parameter settoString()
A String representation of concrete implementation of this classtypeName()
A name identifying the type of parameter set, such as "setup", "observe".
-
Constructor Details
-
ParameterSetType
public ParameterSetType()
-
-
Method Details
-
add
Adds a parameter to the parameter set- Parameters:
parameter
- the parameter to add- Returns:
- a new instance of this parameter set with the given parameter added
-
apply
Return the parameter associated with a Key rather than an Option- Parameters:
key
- the Key to be used for lookup- Returns:
- the parameter associated with the Key or a NoSuchElementException if the key does not exist
-
contains
Returns true if the data contains the given key- Parameters:
key
- (undocumented)- Returns:
- (undocumented)
-
create
Method called by subclass to create a copy with the same key (or other fields) and new parameters. It is protected and subclasses should also keep it as protected to avoid receiving duplicate keys.- Parameters:
data
- a new set of Parameters after addition or deletion- Returns:
- a concrete implementation of type T
-
dataToString
A comma separated string representation of parameters- Returns:
- (undocumented)
-
exists
Returns true if the key exists in the parameter set- Parameters:
key
- the key to check for- Returns:
- true if the key is found
-
find
Find a parameter based on it's keyName and keyType- Parameters:
parameter
- who's keyName and keyType is used to get values and units- Returns:
- an Option of Parameter[S] if it is found, otherwise None
-
get
Returns an Option with the parameter for the key if found, otherwise None- Parameters:
key
- the Key to be used for lookup- Returns:
- the parameter for the key, if found
-
get
Returns an Option with the parameter for the key if found, otherwise None- Parameters:
keyName
- the keyName for a keykeyType
- the keyType for a key- Returns:
- the parameter for the key, if found
-
getStringMap
Returns a map based on this object where the keys and values are in string get (Could be useful for exporting in a get that other languages can read). Derived classes might want to add values to this map for fixed fields.- Returns:
- (undocumented)
-
jFind
A Java helper to find a parameter based on it's keyName and keyType- Parameters:
parameter
- who's keyName and keyType is used to get values and units- Returns:
- an Optional of Parameter[S] if it is found, otherwise empty
-
jGet
Returns an Optional with the parameter for the key if found, otherwise empty- Parameters:
key
- the Key to be used for lookup- Returns:
- the parameter for the key, if found
-
jGet
Returns an Optional with the parameter for the key if found, otherwise empty- Parameters:
keyName
- the keyName for a keykeyType
- the keyType for a key- Returns:
- the parameter for the key, if found
-
jGetStringMap
A Java helper that returns a map based on this object where the keys and values are in string get (Could be useful for exporting in a get that other languages can read). Derived classes might want to add values to this map for fixed fields.- Returns:
- (undocumented)
-
jMadd
-
jMissingKeys
A Java helper that returns a set containing the names of any of the given keys that are missing in the data- Parameters:
keys
- one or more keys- Returns:
- (undocumented)
-
jMissingKeys
A Java helper that returns a set containing the names of any of the given keys that are missing in the data- Parameters:
keys
- one or more keys- Returns:
- (undocumented)
-
jParamSet
A Java helper to get parameters for this parameter set- Returns:
- (undocumented)
-
madd
Adds several parameters to the parameter set- Parameters:
parametersToAdd
- the list of parameters to add to the parameter set- Returns:
- a new instance of this parameter set with the given parameter added
-
madd
Adds several parameters to the parameter set- Parameters:
parametersToAdd
- the list of parameters to add to the parameter set- Returns:
- a new instance of this parameter set with the given parameter added
-
madd
Adds several parameters to the parameter set- Parameters:
parametersToAdd
- the list of parameters to add to the parameter set- Returns:
- a new instance of this parameter set with the given parameter added
-
missingKeys
public scala.collection.immutable.Set<String> missingKeys(scala.collection.immutable.Seq<Key<?>> keys) Returns a set containing the names of any of the given keys that are missing in the data- Parameters:
keys
- one or more keys- Returns:
- a Set of key names
-
paramSet
Holds the parameters for this parameter set- Returns:
- (undocumented)
-
parameter
Returns the actual parameter associated with a key- Parameters:
key
- the Key to be used for lookup- Returns:
- the parameter associated with the key or a NoSuchElementException if the key does not exist
-
remove
Remove a parameter from the parameter set by key- Parameters:
key
- the Key to be used for removal- Returns:
- a new T, where T is a parameter set child with the key removed or identical if the key is not present
-
remove
Removes a parameter based on the parameter- Parameters:
parameter
- to be removed from the parameter set- Returns:
- a new T, where T is a parameter set child with the parameter removed or identical if the parameter is not present
-
size
public int size()The number of parameters in this parameter set- Returns:
- the number of parameters in the parameter set
-
toString
A String representation of concrete implementation of this class -
typeName
A name identifying the type of parameter set, such as "setup", "observe". This is used in the JSON and toString output.- Returns:
- (undocumented)
-