Class Parameter<S>

  • Type Parameters:
    S - the type of items this parameter holds
    All Implemented Interfaces:
    java.io.Serializable, scala.Equals, scala.Product

    public class Parameter<S>
    extends java.lang.Object
    implements scala.Product, java.io.Serializable
    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:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Parameter​(java.lang.String keyName, KeyType<S> keyType, scala.collection.mutable.ArraySeq<S> items, Units units)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      S apply​(int index)
      Returns the value at the given index, throwing an exception if the index is out of range
      scala.Option<S> get​(int index)
      Get method returns an option of value if present at the given index else none
      S head()
      Returns the first value as a convenience when storing a single value
      scala.collection.mutable.ArraySeq<S> items()  
      java.util.Optional<S> jGet​(int index)
      A Java helper that returns an option of value if present at the given index else empty
      java.util.List<S> jValues()
      A Java helper that returns a List of values this parameter holds
      java.lang.String keyName()  
      KeyType<S> keyType()  
      int size()
      The number of values in this parameter (values.size)
      java.lang.String toString()
      Returns a formatted string representation with a KeyName
      Units units()  
      S 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 method
      java.lang.Object values()
      An Array of values this parameter holds
      java.lang.String valuesToString()
      A comma separated string representation of all values this parameter holds
      Parameter<S> withUnits​(Units unitsIn)
      Sets the units for the values
      • Methods 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 Detail

      • Parameter

        public Parameter​(java.lang.String keyName,
                         KeyType<S> keyType,
                         scala.collection.mutable.ArraySeq<S> items,
                         Units units)
    • Method Detail

      • keyName

        public java.lang.String keyName()
      • items

        public scala.collection.mutable.ArraySeq<S> items()
      • units

        public Units units()
      • values

        public java.lang.Object values()
        An Array of values this parameter holds
        Returns:
        (undocumented)
      • jValues

        public java.util.List<S> 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

        public S apply​(int index)
        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

        public S 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 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

        public scala.Option<S> get​(int index)
        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

        public java.util.Optional<S> jGet​(int index)
        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

        public S 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

        public Parameter<S> withUnits​(Units unitsIn)
        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

        public java.lang.String toString()
        Returns a formatted string representation with a KeyName
        Overrides:
        toString in class java.lang.Object
        Returns:
        (undocumented)
      • valuesToString

        public java.lang.String valuesToString()
        A comma separated string representation of all values this parameter holds
        Returns:
        (undocumented)