T
- The enum which defines the possible values of this property.public abstract class EnumGuacamoleProperty<T extends Enum<T>> extends Object implements GuacamoleProperty<T>
EnumGuacamoleProperty.PropertyValue
annotation.Modifier and Type | Class and Description |
---|---|
static interface |
EnumGuacamoleProperty.PropertyValue
Defines the string value which should be accepted and parsed into the
annotated enum constant.
|
Constructor and Description |
---|
EnumGuacamoleProperty(Class<T> enumClass)
Creates a new EnumGuacamoleProperty which parses String property values
into corresponding enum constants as defined by the
EnumGuacamoleProperty.PropertyValue annotations associated with those constants. |
EnumGuacamoleProperty(Map<String,T> valueMapping)
Creates a new EnumGuacamoleProperty which parses String property values
into corresponding enum constants as defined by the given Map.
|
EnumGuacamoleProperty(String key,
T value,
Object... additional)
Creates a new EnumGuacamoleProperty which parses the given String
property values into the given corresponding enum constants.
|
Modifier and Type | Method and Description |
---|---|
T |
parseValue(String value)
Parses the given string value into the type associated with this
GuacamoleProperty.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName
public EnumGuacamoleProperty(Map<String,T> valueMapping)
valueMapping
- A Map which maps all legal String values to their corresponding enum
constants.public EnumGuacamoleProperty(Class<T> enumClass)
EnumGuacamoleProperty.PropertyValue
annotations associated with those constants.enumClass
- The enum whose annotated constants should be used as legal values of
this property.public EnumGuacamoleProperty(String key, T value, Object... additional) throws IllegalArgumentException
key
- The first String value to accept as a legal value of this property.value
- The enum constant that key
should be parsed into.additional
- Any additional key/value pairs to be included beyond the first. This
array must be even in length, where each even element is a String
key and each odd element is the enum constant value to be associated
with the key immediately preceding it.IllegalArgumentException
- If any provided key is not a String, if any provided value is not
an enum constant from the given enum type, or if the length of
additional
is not even.public T parseValue(String value) throws org.apache.guacamole.GuacamoleException
GuacamoleProperty
parseValue
in interface GuacamoleProperty<T extends Enum<T>>
value
- The string value to parse.org.apache.guacamole.GuacamoleException
- If an error occurs while parsing the
provided value.Copyright © 2020. All rights reserved.