Package be.gaudry.model
Class LightObject
java.lang.Object
be.gaudry.model.AbstractLightObject
be.gaudry.model.LightObject
- All Implemented Interfaces:
ILightObject
,Serializable
- Direct Known Subclasses:
ActorRole
,CourseSubject
,Examination
,House
,LightStateObject
,School
,SchoolClass
Basic implementation of the
ILightObject
.
\nThis display
methods may not be override
to avoid breaking the inherited behavior.
Provided by the broldev.core.model project.- Since:
- 1.0 (Nov 27, 2007), broldev.core.model 0.0.1-SNAPSHOT dependency
- Version:
- 1.1 (Nov 21, 2010)
- Author:
- Steph GAUDRY
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from interface be.gaudry.model.ILightObject
DEFAULT_ID
-
Constructor Summary
ConstructorDescriptionBuilds an instance with default values.LightObject(int id, String display)
Builds an instance with an id and a display -
Method Summary
Modifier and TypeMethodDescriptionString representation of the object.int
getId()
Identifier of the ILightObjectvoid
setDisplay(String display)
Sets the display.void
setId(int id)
Methods inherited from class be.gaudry.model.AbstractLightObject
equals, hashCode, toString
-
Field Details
-
display
-
-
Constructor Details
-
LightObject
public LightObject()Builds an instance with default values.- See Also:
AbstractLightObject()
-
LightObject
Builds an instance with an id and a display- Parameters:
id
- identifier of the LightObjectdisplay
- representation of the LightObject- See Also:
AbstractLightObject(int, String)
-
-
Method Details
-
getId
public final int getId()Description copied from interface:ILightObject
Identifier of the ILightObject- Returns:
- the id
-
setId
public final void setId(int id)- Parameters:
id
- the id to set- See Also:
ILightObject.getId()
-
getDisplay
Description copied from interface:ILightObject
String representation of the object. This should be a concise but meaningful representation that is easy for a person to read. \nInto theILightObject
implementations, thetoString()
method is often used to return the values of the properties to debug.- Returns:
- the display
-
setDisplay
Description copied from interface:ILightObject
Sets the display. \nThis general contract does not guarantee that theILightObject.getDisplay()
method will return the same string as the display argument. \nIn many subclasses of the basic implementationAbstractLightObject
, theILightObject.getDisplay()
method returns a String built from a few meaningful properties. Thus, setting the display must be implemented in a way to respect the inheritance principle; the subclass behavior must be the same as expected from the supertype. \nBe careful than overriding this may produces side effects because setting the display may affects other properties. \nA good way is overriding the GenericLightObjectTest<T> class to test this. \n\nMaven dependency for the the GenericLightObjectTest<T>:- groupId: be.gaudry.broldev
- artifactId: broldev.core.jpa-tests
- Parameters:
display
- String representation of the object- See Also:
ILightObject.getDisplay()
-