Record Class RouteSegmentDTO

java.lang.Object
java.lang.Record
com.endurancetrio.business.tracker.dto.RouteSegmentDTO
Record Components:
id - The unique identifier of the RouteSegmentDTO.
order - The order of the segment within the route.
startDevice - The starting device identifier of the segment.
endDevice - The ending device identifier of the segment.
All Implemented Interfaces:
Serializable

public record RouteSegmentDTO(Long id, @NotNull(message="Order is required and cannot be null") @Min(value=1L,message="Order must be at least 1") Integer order, @NotBlank(message="Start device identifier is required") String startDevice, @NotBlank(message="End device identifier is required") String endDevice) extends Record implements Serializable
The RouteSegmentDTO represents a route segment in the EnduranceTrio system.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    RouteSegmentDTO(Long id, @NotNull(message="Order is required and cannot be null") @Min(value=1L,message="Order must be at least 1") Integer order, @NotBlank(message="Start device identifier is required") String startDevice, @NotBlank(message="End device identifier is required") String endDevice)
    Creates an instance of a RouteSegmentDTO record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    @jakarta.validation.constraints.AssertTrue(message="Start and end devices must be different") boolean
     
    @NotBlank(message="End device identifier is required") String
    Returns the value of the endDevice record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    id()
    Returns the value of the id record component.
    @NotNull(message="Order is required and cannot be null") @Min(value=1L,message="Order must be at least 1") Integer
    Returns the value of the order record component.
    @NotBlank(message="Start device identifier is required") String
    Returns the value of the startDevice record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • RouteSegmentDTO

      public RouteSegmentDTO(Long id, @NotNull(message="Order is required and cannot be null") @Min(value=1L,message="Order must be at least 1") @NotNull(message="Order is required and cannot be null") @Min(value=1L,message="Order must be at least 1") Integer order, @NotBlank(message="Start device identifier is required") @NotBlank(message="Start device identifier is required") String startDevice, @NotBlank(message="End device identifier is required") @NotBlank(message="End device identifier is required") String endDevice)
      Creates an instance of a RouteSegmentDTO record class.
      Parameters:
      id - the value for the id record component
      order - the value for the order record component
      startDevice - the value for the startDevice record component
      endDevice - the value for the endDevice record component
  • Method Details

    • areDevicesDifferent

      @AssertTrue(message="Start and end devices must be different") public @jakarta.validation.constraints.AssertTrue(message="Start and end devices must be different") boolean areDevicesDifferent()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      public Long id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • order

      @NotNull(message="Order is required and cannot be null") @Min(value=1L, message="Order must be at least 1") public @NotNull(message="Order is required and cannot be null") @Min(value=1L,message="Order must be at least 1") Integer order()
      Returns the value of the order record component.
      Returns:
      the value of the order record component
    • startDevice

      @NotBlank(message="Start device identifier is required") public @NotBlank(message="Start device identifier is required") String startDevice()
      Returns the value of the startDevice record component.
      Returns:
      the value of the startDevice record component
    • endDevice

      @NotBlank(message="End device identifier is required") public @NotBlank(message="End device identifier is required") String endDevice()
      Returns the value of the endDevice record component.
      Returns:
      the value of the endDevice record component