Class SetListEntry
- java.lang.Object
-
- de.gebit.integrity.remoting.entities.setlist.SetListEntry
-
- All Implemented Interfaces:
Serializable,Cloneable
public class SetListEntry extends Object implements Serializable, 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 SetListEntryclone()booleanequals(Object anOtherObject)SerializablegetAttribute(SetListEntryAttributeKeys aKey)Returns the attribute value for a specific key.SerializablegetAttribute(SetListEntryAttributeKeys aKey, Serializable aValueIfUnset)Returns the attribute value for a specific key, or a default value in case of the attribute being unset.<T extends Serializable>
TgetAttribute(Class<T> anAttributeClass, SetListEntryAttributeKeys aKey)Convenience method to access an attribute.<T extends Serializable>
TgetAttribute(Class<T> anAttributeClass, SetListEntryAttributeKeys aKey, T aValueIfUnset)Convenience method to access an attribute with default value.intgetId()SetListEntryTypesgetType()Returns the type.inthashCode()voidsetAttribute(SetListEntryAttributeKeys aKey, Serializable aValue)Sets the attribute.StringtoString()
-
-
-
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()
-
getType
public SetListEntryTypes getType()
Returns the type. Performs automatic conversion to theSetListEntryTypesenum.- Returns:
-
setAttribute
public void setAttribute(SetListEntryAttributeKeys aKey, Serializable aValue)
Sets the attribute.- Parameters:
aKey- the attribute keyaValue- the value to set
-
getAttribute
public 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 Serializable getAttribute(SetListEntryAttributeKeys aKey, 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 Serializable> T getAttribute(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 Serializable> T getAttribute(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
-
clone
public SetListEntry clone()
-
-