Class SetListEntry
- java.lang.Object
-
- de.gebit.integrity.remoting.entities.setlist.SetListEntry
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
public class SetListEntry extends java.lang.Object implements java.io.Serializable, java.lang.Cloneable
A set list entry is an entry in theSetList
, which is a test execution and result data structure. The actual nature of an entry is defined by its type.- Author:
- Rene Schneider - initial API and implementation
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SetListEntry()
No-arg constructor required for serialization.SetListEntry(int anId, SetListEntryTypes aType)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SetListEntry
clone()
boolean
equals(java.lang.Object anOtherObject)
java.io.Serializable
getAttribute(SetListEntryAttributeKeys aKey)
Returns the attribute value for a specific key.java.io.Serializable
getAttribute(SetListEntryAttributeKeys aKey, java.io.Serializable aValueIfUnset)
Returns the attribute value for a specific key, or a default value in case of the attribute being unset.<T extends java.io.Serializable>
TgetAttribute(java.lang.Class<T> anAttributeClass, SetListEntryAttributeKeys aKey)
Convenience method to access an attribute.<T extends java.io.Serializable>
TgetAttribute(java.lang.Class<T> anAttributeClass, SetListEntryAttributeKeys aKey, T aValueIfUnset)
Convenience method to access an attribute with default value.int
getId()
SetListEntryTypes
getType()
Returns the type.int
hashCode()
void
setAttribute(SetListEntryAttributeKeys aKey, java.io.Serializable aValue)
Sets the attribute.java.lang.String
toString()
-
-
-
Constructor Detail
-
SetListEntry
public SetListEntry(int anId, SetListEntryTypes aType)
Creates a new instance.- Parameters:
anId
-aType
-
-
SetListEntry
public SetListEntry()
No-arg constructor required for serialization.
-
-
Method Detail
-
getId
public int getId()
-
equals
public boolean equals(java.lang.Object anOtherObject)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
getType
public SetListEntryTypes getType()
Returns the type. Performs automatic conversion to theSetListEntryTypes
enum.- Returns:
-
setAttribute
public void setAttribute(SetListEntryAttributeKeys aKey, java.io.Serializable aValue)
Sets the attribute.- Parameters:
aKey
- the attribute keyaValue
- the value to set
-
getAttribute
public java.io.Serializable getAttribute(SetListEntryAttributeKeys aKey)
Returns the attribute value for a specific key.- Parameters:
aKey
- the attribute key- Returns:
- the value, or null if none was set
-
getAttribute
public java.io.Serializable getAttribute(SetListEntryAttributeKeys aKey, java.io.Serializable aValueIfUnset)
Returns the attribute value for a specific key, or a default value in case of the attribute being unset.- Parameters:
aKey
- the attribute keyaValueIfUnset
- the default value- Returns:
- the attribute value or the default
-
getAttribute
public <T extends java.io.Serializable> T getAttribute(java.lang.Class<T> anAttributeClass, SetListEntryAttributeKeys aKey)
Convenience method to access an attribute. Casts the attribute to a specified target class.- Parameters:
anAttributeClass
- the target classaKey
- the attribute key- Returns:
- the casted attribute or null if not set or not castable to the specified class
-
getAttribute
public <T extends java.io.Serializable> T getAttribute(java.lang.Class<T> anAttributeClass, SetListEntryAttributeKeys aKey, T aValueIfUnset)
Convenience method to access an attribute with default value. Casts the attribute to a specified target class.- Parameters:
anAttributeClass
- the target classaKey
- the attribute keyaValueIfUnset
- the default value- Returns:
- the casted value or the default if not set or not castable
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
clone
public SetListEntry clone()
- Overrides:
clone
in classjava.lang.Object
-
-