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

    Fields
    Modifier and Type
    Field
    Description
    static int
    Default uninitialized id value
  • Method Summary

    Modifier and Type
    Method
    Description
    String representation of the object.
    int
    Identifier of the ILightObject
    void
    setDisplay​(String display)
    Sets the display.
    void
    setId​(int id)
     
  • Field Details

    • DEFAULT_ID

      static final int DEFAULT_ID
      Default 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 the ILightObject implementations, the toString() method is often used to return the values of the properties to debug.
      Returns:
      the display
    • setDisplay

      void setDisplay(String display)
      Sets the display. \nThis general contract does not guarantee that the getDisplay() method will return the same string as the display argument. \nIn many subclasses of the basic implementation AbstractLightObject, the 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:
      getDisplay()