java.lang.Object
com.github.jh3nd3rs0n.jargyle.client.Property<V>
Type Parameters:
V - the specified value type

public final class Property<V> extends Object
A property of the specified value type.
  • Method Details

    • newInstance

      public static <V> Property<V> newInstance(String name, V value)
      Returns a new Property of the specified value type with the provided name specified by a PropertySpec and the provided value. An IllegalArgumentException is thrown if the provided name is not specified by any PropertySpec. A ClassCastException is thrown if the provided value is not assignable to the value type defined by the PropertySpec.
      Type Parameters:
      V - the specified value type
      Parameters:
      name - the provided name specified by a PropertySpec
      value - the provided value (can be null)
      Returns:
      a new Property of the specified value type with the provided name specified by a PropertySpec and the provided value
    • newInstanceWithParsedValue

      public static Property<Object> newInstanceWithParsedValue(String name, String value)
      Returns a new Property of the Object value type with the provided name specified by a PropertySpec and with the parsed value from the provided String value. An IllegalArgumentException is thrown if the provided name is not specified by any PropertySpec or the provided String value to be parsed is invalid.
      Parameters:
      name - the provided name specified by a PropertySpec
      value - the provided String value to be parsed
      Returns:
      a new Property of the Object value type with the provided name specified by a PropertySpec and with the parsed value from the provided String value
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getName

      public String getName()
      Returns the name of this Property.
      Returns:
      the name of this Property
    • getPropertySpec

      public PropertySpec<V> getPropertySpec()
      Returns the PropertySpec that defines this Property.
      Returns:
      the PropertySpec that defines this Property
    • getValue

      public V getValue()
      Returns the value of this Property.
      Returns:
      the value of this Property
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Returns the String representation of this Property. The String representation is the name of this Property followed by an equal sign (=) followed by the String representation of the value of this Property.
      Overrides:
      toString in class Object
      Returns:
      the String representation of this Property