net.walend.lyophil.test.stringbean
Class ColorStringBean
java.lang.Object
|
+--net.walend.collection.test.TestBean
|
+--net.walend.lyophil.test.stringbean.StringBean
|
+--net.walend.lyophil.test.stringbean.ColorStringBean
- All Implemented Interfaces:
- Freezable, FreezableColorString, FreezableString, HasState, HasTypableKey, java.io.Serializable, TestString
- public class ColorStringBean
- extends StringBean
- implements FreezableColorString
A simple bean for tests.
- Since:
- 12-6-2000
- Author:
- David Walend
Field Summary |
private java.lang.String |
color
|
Fields inherited from class net.walend.lyophil.test.stringbean.StringBean |
|
Fields inherited from class net.walend.collection.test.TestBean |
|
Constructor Summary |
ColorStringBean(java.io.Serializable identifier,
java.lang.String role,
Mother mom,
java.lang.String string,
java.lang.String typableKey,
java.lang.String color)
|
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.lang.String |
getColorString()
|
java.lang.Class |
getPrincipleInterface()
Returns the class's principle interface for state comparisons. |
boolean |
sameIdentifierAs(Freezable object)
Returns true if this Freezable represents the same information as the Freezable object, ie if they
have the same identifier. |
boolean |
sameStateAs(HasState object)
If two HasStates have the same internal state, return true. |
void |
setColorString(java.lang.String color)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
color
private java.lang.String color
ColorStringBean
public ColorStringBean(java.io.Serializable identifier,
java.lang.String role,
Mother mom,
java.lang.String string,
java.lang.String typableKey,
java.lang.String color)
getColorString
public java.lang.String getColorString()
- Specified by:
getColorString
in interface FreezableColorString
setColorString
public void setColorString(java.lang.String color)
- Specified by:
setColorString
in interface FreezableColorString
sameIdentifierAs
public boolean sameIdentifierAs(Freezable object)
- Description copied from interface:
Freezable
- Returns true if this Freezable represents the same information as the Freezable object, ie if they
have the same identifier.
- Specified by:
sameIdentifierAs
in interface Freezable
- Overrides:
sameIdentifierAs
in class StringBean
getPrincipleInterface
public java.lang.Class getPrincipleInterface()
- Description copied from interface:
HasState
- Returns the class's principle interface for state comparisons. If two objects have different principle interfaces, they never have the same state.
- Specified by:
getPrincipleInterface
in interface HasState
- Overrides:
getPrincipleInterface
in class StringBean
sameStateAs
public boolean sameStateAs(HasState object)
- Description copied from interface:
HasState
- If two HasStates have the same internal state, return true.
For objects with subobjects, Generally this method should only return true if the internal objects are equal. Implement a contentsHaveSameState() method to determine if the contents have the same state.
- Specified by:
sameStateAs
in interface HasState
- Overrides:
sameStateAs
in class StringBean
createEvilClone
public Freezable createEvilClone(Mother mom,
java.lang.String role)
- Description copied from interface:
Freezable
- 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.
- Specified by:
createEvilClone
in interface Freezable
- Overrides:
createEvilClone
in class StringBean
toString
public java.lang.String toString()
- Specified by:
toString
in interface TestString
- Overrides:
toString
in class StringBean
Copyright (c) 2000, 2001, David Walend