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 TypeMethodDescriptionbooleangetName()Returns the name of thisProperty.Returns thePropertySpecthat defines thisProperty.getValue()Returns the value of thisProperty.inthashCode()static <V> Property<V> newInstance(String name, V value) Returns a newPropertyof the specified value type with the provided name specified by aPropertySpecand the provided value.newInstanceWithParsedValue(String name, String value) Returns a newPropertyof theObjectvalue type with the provided name specified by aPropertySpecand with the parsed value from the providedStringvalue.toString()Returns theStringrepresentation of thisProperty.
-
Method Details
-
newInstance
Returns a newPropertyof the specified value type with the provided name specified by aPropertySpecand the provided value. AnIllegalArgumentExceptionis thrown if the provided name is not specified by anyPropertySpec. AClassCastExceptionis 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 aPropertySpecvalue- the provided value (can benull)- Returns:
- a new
Propertyof the specified value type with the provided name specified by aPropertySpecand the provided value
-
newInstanceWithParsedValue
Returns a newPropertyof theObjectvalue type with the provided name specified by aPropertySpecand with the parsed value from the providedStringvalue. AnIllegalArgumentExceptionis thrown if the provided name is not specified by anyPropertySpecor the providedStringvalue to be parsed is invalid.- Parameters:
name- the provided name specified by aPropertySpecvalue- the providedStringvalue to be parsed- Returns:
- a new
Propertyof theObjectvalue type with the provided name specified by aPropertySpecand with the parsed value from the providedStringvalue
-
equals
-
getName
Returns the name of thisProperty.- Returns:
- the name of this
Property
-
getPropertySpec
Returns thePropertySpecthat defines thisProperty.- Returns:
- the
PropertySpecthat defines thisProperty
-
getValue
Returns the value of thisProperty.- Returns:
- the value of this
Property
-
hashCode
public int hashCode() -
toString
Returns theStringrepresentation of thisProperty. TheStringrepresentation is the name of thisPropertyfollowed by an equal sign (=) followed by theStringrepresentation of the value of thisProperty.
-