Package csw.params.core.generics
Class Key<S>
- java.lang.Object
-
- csw.params.core.generics.Key<S>
-
- All Implemented Interfaces:
java.io.Serializable
,scala.Equals
,scala.Product
- Direct Known Subclasses:
GChoiceKey
public class Key<S> extends java.lang.Object implements scala.Product, java.io.Serializable
A generic Key class. Never meant to be instantiated directly.KeyType
exposes allowed types of Keys and make method to create instances of Key.param: keyName the name of the key param: keyType reference to an object of type KeyType[S] param: units applicable units
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object that)
Equals this Key instance with other by the keyNameint
hashCode()
java.lang.String
keyName()
KeyType<S>
keyType()
Parameter<S>
set(S value, java.lang.Object... values)
Sets the values for the key using a variable number of argumentsParameter<S>
set(S value, scala.collection.immutable.Seq<S> values)
Sets the values for the key using a variable number of argumentsParameter<S>
setAll(java.lang.Object values)
Set values against this keyjava.lang.String
toString()
Returns a string representation of Key as keyNameUnits
units()
-
-
-
Method Detail
-
set
public Parameter<S> set(S value, java.lang.Object... values)
Sets the values for the key using a variable number of arguments- Parameters:
values
- one or more values- Returns:
- an instance of Parameter[S] containing the key name, values (call withUnits() on the result to set the units)
-
keyName
public java.lang.String keyName()
-
units
public Units units()
-
setAll
public Parameter<S> setAll(java.lang.Object values)
Set values against this key- Parameters:
values
- an Array of values- Returns:
- an instance of Parameter[S] containing the key name, values (call withUnits() on the result to set the units)
-
set
public Parameter<S> set(S value, scala.collection.immutable.Seq<S> values)
Sets the values for the key using a variable number of arguments- Parameters:
values
- one or more values- Returns:
- an instance of Parameter[S] containing the key name, values (call withUnits() on the result to set the units)
-
toString
public java.lang.String toString()
Returns a string representation of Key as keyName- Overrides:
toString
in classjava.lang.Object
- Returns:
- (undocumented)
-
equals
public boolean equals(java.lang.Object that)
Equals this Key instance with other by the keyName- Specified by:
equals
in interfacescala.Equals
- Overrides:
equals
in classjava.lang.Object
- Parameters:
that
- the other Key instance that is to be equated against this Key instance- Returns:
- a Boolean indicating whether two Key instances are equal or not
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-