Class StyleCapture.Property
- java.lang.Object
-
- ca.cgjennings.apps.arkham.deck.item.StyleCapture.Property
-
- Enclosing class:
- StyleCapture
public static final class StyleCapture.Property extends java.lang.Object
Encapsulates a captured style property.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
Returnstrue
if the specified object is aProperty
with the same name and value.java.lang.String
getName()
Returns the name of this property.java.lang.Class<? extends Style>
getStyle()
Returns theClass
object for theStyle
interface that this property belongs to.java.lang.Class<?>
getType()
Returns theClass
instance that represents the original type of the property.java.lang.Object
getValue()
Returns the value of the property.int
hashCode()
boolean
isConflicted()
Returnstrue
if the property has had different values during the life of this capture.void
setValue(java.lang.Object value)
Sets the value of the property.java.lang.String
toString()
Returns a debugging string that describes the property and its value.
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the name of this property. The property's name will be the name of the getter method use to read the property from itsStyle
interface, without the "get" or "is" prefix.- Returns:
- the name of the property
-
getValue
public java.lang.Object getValue()
Returns the value of the property. This is the value of the most recently captured property with this name.- Returns:
- the property value
-
setValue
public void setValue(java.lang.Object value)
Sets the value of the property. The class of the value object must be compatible with the type of the property.- Parameters:
value
- the new value to assign to the property
-
getType
public java.lang.Class<?> getType()
Returns theClass
instance that represents the original type of the property. For example, if the property being read has typefloat
then the object returned by {#link getValue()} will be aFloat
instance and the type returned by this method will befloat.class
.- Returns:
- the actual type of the captured property value, as declared in its getter method
-
getStyle
public java.lang.Class<? extends Style> getStyle()
Returns theClass
object for theStyle
interface that this property belongs to.- Returns:
- the style interface that the property is declared in
-
isConflicted
public boolean isConflicted()
Returnstrue
if the property has had different values during the life of this capture.- Returns:
true
if different values have been captured for this property
-
toString
public java.lang.String toString()
Returns a debugging string that describes the property and its value.- Overrides:
toString
in classjava.lang.Object
- Returns:
- a string that describes this property
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
Returnstrue
if the specified object is aProperty
with the same name and value. (If this returnstrue
the type and style must match unless the contract forStyle
has been violated.)- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
- the object to compare this property with- Returns:
true
if the object represents the same property and has an equal value
-
-