- java.lang.Object
-
- org.praxislive.core.Value
-
- org.praxislive.core.ArgumentInfo
-
public final class ArgumentInfo extends Value
Info object used to define the valid input and output arguments of a Control. As well as giving the type of the argument, an ArgumentInfo can have an optional set of properties. This might be used for defining the "minimum" and "maximum" values of a PNumber argument, for example.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.praxislive.core.Value
Value.Type<T extends Value>
-
-
Field Summary
Fields Modifier and Type Field Description static String
KEY_ALLOW_EMPTY
static String
KEY_ALLOWED_VALUES
static String
KEY_EMPTY_IS_DEFAULT
static String
KEY_MIME_TYPE
static String
KEY_OPTIONAL
static String
KEY_SUGGESTED_VALUES
static String
KEY_TEMPLATE
static String
KEY_VARARGS
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Value.Type<? extends Value>
argumentType()
boolean
equals(Object obj)
Values must override the default equals method.static Optional<ArgumentInfo>
from(Value arg)
int
hashCode()
Values must override the default hashcode method.static ArgumentInfo
of(Class<? extends Value> argClass)
Create an ArgumentInfo from the Value class and optional PMap of additional properties.static ArgumentInfo
of(Class<? extends Value> argClass, PMap properties)
Create an ArgumentInfo from the Value class and optional PMap of additional properties.static ArgumentInfo
parse(String string)
PMap
properties()
String
toString()
Values must override the default method to return a string representation that is immutable.
-
-
-
Field Detail
-
KEY_ALLOWED_VALUES
public static final String KEY_ALLOWED_VALUES
- See Also:
- Constant Field Values
-
KEY_SUGGESTED_VALUES
public static final String KEY_SUGGESTED_VALUES
- See Also:
- Constant Field Values
-
KEY_ALLOW_EMPTY
public static final String KEY_ALLOW_EMPTY
- See Also:
- Constant Field Values
-
KEY_EMPTY_IS_DEFAULT
public static final String KEY_EMPTY_IS_DEFAULT
- See Also:
- Constant Field Values
-
KEY_TEMPLATE
public static final String KEY_TEMPLATE
- See Also:
- Constant Field Values
-
KEY_MIME_TYPE
public static final String KEY_MIME_TYPE
- See Also:
- Constant Field Values
-
KEY_OPTIONAL
public static final String KEY_OPTIONAL
- See Also:
- Constant Field Values
-
KEY_VARARGS
public static final String KEY_VARARGS
- See Also:
- Constant Field Values
-
-
Method Detail
-
argumentType
public Value.Type<? extends Value> argumentType()
-
properties
public PMap properties()
- Returns:
- PMap properties
-
toString
public String toString()
Description copied from class:Value
Values must override the default method to return a string representation that is immutable.
-
equals
public boolean equals(Object obj)
Description copied from class:Value
Values must override the default equals method. This method should only returntrue
if the supplied Object is of the same type as the implementing Value. Values of an unknown type should be coerced before calling this method. This method does not have to guarantee thatthis.equals(that) == this.toString().equals(that.toString())
-
hashCode
public int hashCode()
Description copied from class:Value
Values must override the default hashcode method.
-
of
public static ArgumentInfo of(Class<? extends Value> argClass)
Create an ArgumentInfo from the Value class and optional PMap of additional properties.- Parameters:
argClass
-- Returns:
- ArgumentInfo
-
of
public static ArgumentInfo of(Class<? extends Value> argClass, PMap properties)
Create an ArgumentInfo from the Value class and optional PMap of additional properties.- Parameters:
argClass
-properties
-- Returns:
- ArgumentInfo
-
from
public static Optional<ArgumentInfo> from(Value arg)
-
parse
public static ArgumentInfo parse(String string) throws ValueFormatException
- Throws:
ValueFormatException
-
-