Class Property<V>
java.lang.Object
com.github.jh3nd3rs0n.jargyle.client.Property<V>
- Type Parameters:
V
- the specified value type
A property of the specified value type.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
getName()
Returns the name of thisProperty
.Returns thePropertySpec
that defines thisProperty
.getValue()
Returns the value of thisProperty
.int
hashCode()
static <V> Property
<V> newInstance
(String name, V value) Returns a newProperty
of the specified value type with the provided name specified by aPropertySpec
and the provided value.newInstanceWithParsedValue
(String name, String value) Returns a newProperty
of theObject
value type with the provided name specified by aPropertySpec
and with the parsed value from the providedString
value.toString()
Returns theString
representation of thisProperty
.
-
Method Details
-
newInstance
Returns a newProperty
of the specified value type with the provided name specified by aPropertySpec
and the provided value. AnIllegalArgumentException
is thrown if the provided name is not specified by anyPropertySpec
. AClassCastException
is thrown if the provided value is not assignable to the value type defined by thePropertySpec
.- Type Parameters:
V
- the specified value type- Parameters:
name
- the provided name specified by aPropertySpec
value
- the provided value (can benull
)- Returns:
- a new
Property
of the specified value type with the provided name specified by aPropertySpec
and the provided value
-
newInstanceWithParsedValue
Returns a newProperty
of theObject
value type with the provided name specified by aPropertySpec
and with the parsed value from the providedString
value. AnIllegalArgumentException
is thrown if the provided name is not specified by anyPropertySpec
or the providedString
value to be parsed is invalid.- Parameters:
name
- the provided name specified by aPropertySpec
value
- the providedString
value to be parsed- Returns:
- a new
Property
of theObject
value type with the provided name specified by aPropertySpec
and with the parsed value from the providedString
value
-
equals
-
getName
Returns the name of thisProperty
.- Returns:
- the name of this
Property
-
getPropertySpec
Returns thePropertySpec
that defines thisProperty
.- Returns:
- the
PropertySpec
that defines thisProperty
-
getValue
Returns the value of thisProperty
.- Returns:
- the value of this
Property
-
hashCode
public int hashCode() -
toString
Returns theString
representation of thisProperty
. TheString
representation is the name of thisProperty
followed by an equal sign (=) followed by theString
representation of the value of thisProperty
.
-