Class Route
java.lang.Object
com.endurancetrio.data.common.model.entity.AuditableEntity
com.endurancetrio.data.common.model.entity.BaseEntity<Long>
com.endurancetrio.data.tracker.model.entity.Route
- All Implemented Interfaces:
Serializable
The
Route represents a route segment in the EnduranceTrio Tracker system.
The Route fields are defined as follows:
-
BaseEntity.getId()id : The unique identifier of theRoutethat is automatically generated and is the primary key. -
getReference()name : The name of the route -
getSegments()segments : The list of segments that make up the route -
AuditableEntity.getCreatedAt()createdAt : The system timestamp of creation, inherited fromAuditableEntity. -
AuditableEntity.getUpdatedAt()updatedAt : The system timestamp of the last update, inherited fromAuditableEntity.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSegment(RouteSegment segment) Utility method to add a segment to the route.booleanEquality is based on the entity's identifier.inthashCode()voidremoveSegment(RouteSegment segment) Utility method to remove a segment from the route.voidsetReference(String reference) voidsetSegments(List<RouteSegment> segments) toString()Methods inherited from class com.endurancetrio.data.common.model.entity.BaseEntity
getId, setIdMethods inherited from class com.endurancetrio.data.common.model.entity.AuditableEntity
getCreatedAt, getUpdatedAt, getVersion
-
Constructor Details
-
Route
public Route()
-
-
Method Details
-
addSegment
Utility method to add a segment to the route.- Parameters:
segment- the segment to add
-
removeSegment
Utility method to remove a segment from the route.- Parameters:
segment- the segment to remove
-
getReference
-
setReference
-
getSegments
-
setSegments
-
equals
Description copied from class:BaseEntityEquality is based on the entity's identifier. Two entities are considered equal if they are of the same class and have the same non-null identifier.If the ID is null, we treat it as a transient (new) object. Transient objects are only equal if they are the exact same instance.
- Overrides:
equalsin classBaseEntity<Long>
-
hashCode
public int hashCode()- Overrides:
hashCodein classBaseEntity<Long>
-
toString
-