net.walend.lyophil
Interface Freezable

All Superinterfaces:
HasState, java.io.Serializable
All Known Subinterfaces:
FreezableColorString, FreezableSet, FreezableString
All Known Implementing Classes:
ColorStringBean, FreezableDelegatingMutableSet, JDBCBackedMutableSet, StringBean

public interface Freezable
extends java.io.Serializable, HasState

Objects for persistent storage should implement this interface.

Freezables should implement a no argument constructor for Serialization.

Freezables should implement a constructor that has the Serializable identifier as the first argument, String role as the second and Mother mom as the third for compatibility with GenericMother.

Since:
20001121
Author:
David Walend

Method Summary
 Freezable createEvilClone(Mother mom, java.lang.String role)
          Returns a new instance of a Freezable with the same internal state as this Freezable, but with the new id.
 java.io.Serializable getIdentifier()
          Get the identifier for this instance.
 java.lang.String getRole()
          Get the role for this instance.
 boolean sameAs(Freezable object)
          Returns true if this Freezable represents the samee information as object, and their internal state matches.
 boolean sameIdentifierAs(Freezable object)
          Returns true if this Freezable represents the same information as the Freezable object, ie if they have the same identifier.
 
Methods inherited from interface net.walend.collection.HasState
getPrincipleInterface, sameStateAs
 

Method Detail

getIdentifier

public java.io.Serializable getIdentifier()
Get the identifier for this instance. I've always used a Long, but the ejb spec says it can be anything. Try to use something immutable. Note that you will only have this Object plus metadetails of the class to use for identifier information. All you should need is the identifier.


getRole

public java.lang.String getRole()
Get the role for this instance.


sameIdentifierAs

public boolean sameIdentifierAs(Freezable object)
Returns true if this Freezable represents the same information as the Freezable object, ie if they have the same identifier.


sameAs

public boolean sameAs(Freezable object)
Returns true if this Freezable represents the samee information as object, and their internal state matches.


createEvilClone

public Freezable createEvilClone(Mother mom,
                                 java.lang.String role)
Returns a new instance of a Freezable with the same internal state as this Freezable, but with the new id. This method should only be called by Mother.



Copyright (c) 2000, 2001, David Walend