Package be.gaudry.model
Interface ILightObject
- All Known Implementing Classes:
AbstractLightObject
,Actor
,ActorRole
,BeIDPerson
,BrolCategory
,BrolType
,Course
,CourseSubject
,Examination
,House
,HouseHibernateWrapper
,LightObject
,LightStateObject
,Meter
,MeterHibernateWrapper
,Period
,Person
,Person
,PersonExt
,School
,SchoolClass
,SchoolYear
,Serie
,Student
,Teacher
,VehicleMeter
public interface ILightObject
Forces to have an id and a displayable string.
\nThe toString method provides a simple, convenient mechanism for debugging classes during development,
or for logging. When used in these informal ways, the exact format of toString is not part of the contract
of the method, and callers should not rely on the exact format of the returned String. Implementing the
ILightObject forces to provide a stronger meaningful string to display, keeping the toString
method for debugging.
\nA basic implementation is also provided (
AbstractLightObject
).
Provided by the broldev.core.model project.- Since:
- (1.0 Nov 7, 2007), broldev.core.model 0.0.1-SNAPSHOT dependency
- Version:
- (1.0 Nov 7, 2007)
- Author:
- Steph GAUDRY
-
Field Summary
-
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)
-
Field Details
-
DEFAULT_ID
static final int DEFAULT_IDDefault uninitialized id value- See Also:
- Constant Field Values
-
-
Method Details
-
getId
int getId()Identifier of the ILightObject- Returns:
- the id
-
setId
void setId(int id)- Parameters:
id
- the id to set- See Also:
getId()
-
getDisplay
String getDisplay()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
Sets the display. \nThis general contract does not guarantee that thegetDisplay()
method will return the same string as the display argument. \nIn many subclasses of the basic implementationAbstractLightObject
, thegetDisplay()
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:
getDisplay()
-