Package csw.params.core.generics
Class Parameter<S>
java.lang.Object
csw.params.core.generics.Parameter<S>
- Type Parameters:
S
- the type of items this parameter holds
- All Implemented Interfaces:
Serializable
,scala.Equals
,scala.Product
Parameter represents a KeyName, KeyType, array of values and units applicable to values. Parameter sits as payload for
sending commands and events between components.
param: keyName the name of the key param: keyType reference to an object of type KeyType[S] param: items an Array of values of type S param: units applicable units
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionapply
(int index) Returns the value at the given index, throwing an exception if the index is out of rangescala.Option<S>
get
(int index) Get method returns an option of value if present at the given index else nonehead()
Returns the first value as a convenience when storing a single valuescala.collection.mutable.ArraySeq<S>
items()
jGet
(int index) A Java helper that returns an option of value if present at the given index else emptyjValues()
A Java helper that returns a List of values this parameter holdskeyName()
keyType()
int
size()
The number of values in this parameter (values.size)toString()
Returns a formatted string representation with a KeyNameunits()
value
(int index) Returns the value at the given index, throwing an exception if the index is out of range This is a Scala convenience methodvalues()
An Array of values this parameter holdsA comma separated string representation of all values this parameter holdsSets the units for the valuesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface scala.Equals
canEqual, equals
Methods inherited from interface scala.Product
productArity, productElement, productElementName, productElementNames, productIterator, productPrefix
-
Constructor Details
-
Parameter
-
-
Method Details
-
keyName
-
keyType
-
items
-
units
-
values
An Array of values this parameter holds- Returns:
- (undocumented)
-
jValues
A Java helper that returns a List of values this parameter holds- Returns:
- (undocumented)
-
size
public int size()The number of values in this parameter (values.size)- Returns:
- length of the array of items
-
apply
Returns the value at the given index, throwing an exception if the index is out of range- Parameters:
index
- the index of a value- Returns:
- the value at the given index (may throw an exception if the index is out of range)
-
value
Returns the value at the given index, throwing an exception if the index is out of range This is a Scala convenience method- Parameters:
index
- the index of a value- Returns:
- the value at the given index (may throw an exception if the index is out of range)
-
get
Get method returns an option of value if present at the given index else none- Parameters:
index
- the index of a value- Returns:
- some value at the given index as an Option, if the index is in range, otherwise None
-
jGet
A Java helper that returns an option of value if present at the given index else empty- Parameters:
index
- the index of a value- Returns:
- value at the given index as an Optional, if the index is in range, otherwise empty
-
head
Returns the first value as a convenience when storing a single value- Returns:
- the first or default value (Use this if you know there is only a single value)
-
withUnits
Sets the units for the values- Parameters:
unitsIn
- the units for the values- Returns:
- a new instance of this parameter with the units set
-
toString
Returns a formatted string representation with a KeyName -
valuesToString
A comma separated string representation of all values this parameter holds- Returns:
- (undocumented)
-