Package be.gaudry.model.edu.course
Class Course
java.lang.Object
be.gaudry.model.edu.course.Course
- All Implemented Interfaces:
ILightObject
Concrete course (subject, teacher, parent course, location, goals, etc)
- Since:
- 1.0 Oct 12, 2008, 1.0
- Version:
- %I%, %G%
- Author:
- Steph GAUDRY
-
Field Summary
Fields inherited from interface be.gaudry.model.ILightObject
DEFAULT_ID
-
Constructor Summary
ConstructorDescriptionCourse()
Course(int id, CourseSubject subject)
Course(int id, CourseSubject subject, Collection<Examination> examinations)
Course(CourseSubject subject)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add(Examination examination)
boolean
Indicates whether some other object is "equal to" this course.String representation of the object.int
getId()
Identifier of the ILightObjectint
hashCode()
Returns a hash code value for the course.void
remove(Examination examination)
void
setDisplay(String display)
Sets the display.void
setId(int id)
void
setParentCourse(Course parentCourse)
void
setSubject(CourseSubject subject)
toString()
-
Constructor Details
-
Course
public Course() -
Course
- Parameters:
subject
-
-
Course
- Parameters:
id
-subject
-
-
Course
- Parameters:
id
-subject
-
-
-
Method Details
-
add
-
remove
-
getSubject
- Returns:
- the subject
-
setSubject
- Parameters:
subject
- the subject to set
-
getExaminations
- Returns:
- the examinations
-
getParentCourse
- Returns:
- the parentCourse
-
setParentCourse
- Parameters:
parentCourse
- the parentCourse to set
-
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.- Specified by:
getDisplay
in interfaceILightObject
- 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
- Specified by:
setDisplay
in interfaceILightObject
- Parameters:
display
- String representation of the object- See Also:
ILightObject.getDisplay()
-
getId
public int getId()Description copied from interface:ILightObject
Identifier of the ILightObject- Specified by:
getId
in interfaceILightObject
- Returns:
- the id
-
setId
public void setId(int id)- Specified by:
setId
in interfaceILightObject
- Parameters:
id
- the id to set- See Also:
ILightObject.getId()
-
equals
Indicates whether some other object is "equal to" this course. Some fields are not checked here :Parent course
- List of
examinations
(examinations
)
- Overrides:
equals
in classObject
- Parameters:
obj
- the reference object with which to compare.- Returns:
true
if this course is the same as the obj argument;false
otherwise.- See Also:
Object.equals(java.lang.Object)
,hashCode()
-
hashCode
public int hashCode()Returns a hash code value for the course. Some fields are not considered here :Parent course
- List of
examinations
(examinations
)
- Overrides:
hashCode
in classObject
- Returns:
- a hash code value for this course.
- See Also:
Object.hashCode()
,equals(Object)
-
toString
- Overrides:
toString
in classObject
- See Also:
AbstractLightObject.toString()
-