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
ConstructorsConstructorDescriptionDeviceTelemetryDTO(@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 aDeviceTelemetryDTOrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanactive()Returns the value of theactiverecord component.@NotBlank(message="Device identifier is required") @Size(min=1,max=50,message="Device identifier must be between 1 and 50 characters") Stringdevice()Returns the value of thedevicerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()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") Doublelatitude()Returns the value of thelatituderecord 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") DoubleReturns the value of thelongituderecord component.@NotNull(message="Timestamp cannot be null") Instanttime()Returns the value of thetimerecord component.final StringtoString()Returns a string representation of this record class.
-
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 aDeviceTelemetryDTOrecord class.- Parameters:
device- the value for thedevicerecord componenttime- the value for thetimerecord componentlatitude- the value for thelatituderecord componentlongitude- the value for thelongituderecord componentactive- the value for theactiverecord component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
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 thedevicerecord component.- Returns:
- the value of the
devicerecord component
-
time
@NotNull(message="Timestamp cannot be null") public @NotNull(message="Timestamp cannot be null") Instant time()Returns the value of thetimerecord component.- Returns:
- the value of the
timerecord 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 thelatituderecord component.- Returns:
- the value of the
latituderecord 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 thelongituderecord component.- Returns:
- the value of the
longituderecord component
-
active
public boolean active()Returns the value of theactiverecord component.- Returns:
- the value of the
activerecord component
-