Class 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 the SetList, 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 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 class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • setAttribute

        public void setAttribute​(SetListEntryAttributeKeys aKey,
                                 java.io.Serializable aValue)
        Sets the attribute.
        Parameters:
        aKey - the attribute key
        aValue - 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 key
        aValueIfUnset - 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 class
        aKey - 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 class
        aKey - the attribute key
        aValueIfUnset - 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 class java.lang.Object
      • clone

        public SetListEntry clone()
        Overrides:
        clone in class java.lang.Object