Record Class DeviceTelemetryDTO

java.lang.Object
java.lang.Record
com.endurancetrio.business.tracker.dto.DeviceTelemetryDTO
All Implemented Interfaces:
Serializable

public record DeviceTelemetryDTO(@NotBlank(message="Device identifier is required") @Size(min=1,max=50,message="Device identifier must be between 1 and 50 characters") String device, @NotNull(message="Timestamp cannot be null") Instant time, @NotNull(message="Latitude cannot be null") @DecimalMin(value="-90.0",message="Latitude must be between -90 and 90") @DecimalMax(value="90.0",message="Latitude must be between -90 and 90") Double latitude, @NotNull(message="Longitude cannot be null") @DecimalMin(value="-180.0",message="Longitude must be between -180 and 180") @DecimalMax(value="180.0",message="Longitude must be between -180 and 180") Double longitude, boolean active) extends Record implements Serializable
The DeviceTelemetryDTO represents the telemetry data recorded by a device at a specific time.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    DeviceTelemetryDTO(@NotBlank(message="Device identifier is required") @Size(min=1,max=50,message="Device identifier must be between 1 and 50 characters") String device, @NotNull(message="Timestamp cannot be null") Instant time, @NotNull(message="Latitude cannot be null") @DecimalMin(value="-90.0",message="Latitude must be between -90 and 90") @DecimalMax(value="90.0",message="Latitude must be between -90 and 90") Double latitude, @NotNull(message="Longitude cannot be null") @DecimalMin(value="-180.0",message="Longitude must be between -180 and 180") @DecimalMax(value="180.0",message="Longitude must be between -180 and 180") Double longitude, boolean active)
    Creates an instance of a DeviceTelemetryDTO record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns the value of the active record component.
    @NotBlank(message="Device identifier is required") @Size(min=1,max=50,message="Device identifier must be between 1 and 50 characters") String
    Returns the value of the device record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    @NotNull(message="Latitude cannot be null") @DecimalMin(value="-90.0",message="Latitude must be between -90 and 90") @DecimalMax(value="90.0",message="Latitude must be between -90 and 90") Double
    Returns the value of the latitude record component.
    @NotNull(message="Longitude cannot be null") @DecimalMin(value="-180.0",message="Longitude must be between -180 and 180") @DecimalMax(value="180.0",message="Longitude must be between -180 and 180") Double
    Returns the value of the longitude record component.
    @NotNull(message="Timestamp cannot be null") Instant
    Returns the value of the time 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

    • DeviceTelemetryDTO

      public DeviceTelemetryDTO(@NotBlank(message="Device identifier is required") @Size(min=1,max=50,message="Device identifier must be between 1 and 50 characters") @NotBlank(message="Device identifier is required") @Size(min=1,max=50,message="Device identifier must be between 1 and 50 characters") String device, @NotNull(message="Timestamp cannot be null") @NotNull(message="Timestamp cannot be null") Instant time, @NotNull(message="Latitude cannot be null") @DecimalMin(value="-90.0",message="Latitude must be between -90 and 90") @DecimalMax(value="90.0",message="Latitude must be between -90 and 90") @NotNull(message="Latitude cannot be null") @DecimalMin(value="-90.0",message="Latitude must be between -90 and 90") @DecimalMax(value="90.0",message="Latitude must be between -90 and 90") Double latitude, @NotNull(message="Longitude cannot be null") @DecimalMin(value="-180.0",message="Longitude must be between -180 and 180") @DecimalMax(value="180.0",message="Longitude must be between -180 and 180") @NotNull(message="Longitude cannot be null") @DecimalMin(value="-180.0",message="Longitude must be between -180 and 180") @DecimalMax(value="180.0",message="Longitude must be between -180 and 180") Double longitude, boolean active)
      Creates an instance of a DeviceTelemetryDTO record class.
      Parameters:
      device - the value for the device record component
      time - the value for the time record component
      latitude - the value for the latitude record component
      longitude - the value for the longitude record component
      active - the value for the active record component
  • Method Details

    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • device

      @NotBlank(message="Device identifier is required") @Size(min=1, max=50, message="Device identifier must be between 1 and 50 characters") public @NotBlank(message="Device identifier is required") @Size(min=1,max=50,message="Device identifier must be between 1 and 50 characters") String device()
      Returns the value of the device record component.
      Returns:
      the value of the device record component
    • time

      @NotNull(message="Timestamp cannot be null") public @NotNull(message="Timestamp cannot be null") Instant time()
      Returns the value of the time record component.
      Returns:
      the value of the time record component
    • latitude

      @NotNull(message="Latitude cannot be null") @DecimalMin(value="-90.0", message="Latitude must be between -90 and 90") @DecimalMax(value="90.0", message="Latitude must be between -90 and 90") public @NotNull(message="Latitude cannot be null") @DecimalMin(value="-90.0",message="Latitude must be between -90 and 90") @DecimalMax(value="90.0",message="Latitude must be between -90 and 90") Double latitude()
      Returns the value of the latitude record component.
      Returns:
      the value of the latitude record component
    • longitude

      @NotNull(message="Longitude cannot be null") @DecimalMin(value="-180.0", message="Longitude must be between -180 and 180") @DecimalMax(value="180.0", message="Longitude must be between -180 and 180") public @NotNull(message="Longitude cannot be null") @DecimalMin(value="-180.0",message="Longitude must be between -180 and 180") @DecimalMax(value="180.0",message="Longitude must be between -180 and 180") Double longitude()
      Returns the value of the longitude record component.
      Returns:
      the value of the longitude record component
    • active

      public boolean active()
      Returns the value of the active record component.
      Returns:
      the value of the active record component