Record Class TrackerAccountDTO
java.lang.Object
java.lang.Record
com.endurancetrio.business.tracker.dto.TrackerAccountDTO
- All Implemented Interfaces:
Serializable
public record TrackerAccountDTO(@NotBlank(message="Owner is required") @Size(min=1,max=50,message="Owner must be between 1 and 50 characters") String owner, @NotBlank(message="Key is required") @Size(min=32,max=64,message="Key must be between 32 and 64 characters") @Pattern(regexp="^[A-Za-z0-9]+$",message="Key must contain only alphanumeric characters") String key, boolean enabled)
extends Record
implements Serializable
The
TrackerAccountDTO represents a tracker account with its owner, key, and enabled
status.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTrackerAccountDTO(@NotBlank(message="Owner is required") @Size(min=1,max=50,message="Owner must be between 1 and 50 characters") String owner, @NotBlank(message="Key is required") @Size(min=32,max=64,message="Key must be between 32 and 64 characters") @Pattern(regexp="^[A-Za-z0-9]+$",message="Key must contain only alphanumeric characters") String key, boolean enabled) Creates an instance of aTrackerAccountDTOrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanenabled()Returns the value of theenabledrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotBlank(message="Key is required") @Size(min=32,max=64,message="Key must be between 32 and 64 characters") @Pattern(regexp="^[A-Za-z0-9]+$",message="Key must contain only alphanumeric characters") Stringkey()Returns the value of thekeyrecord component.@NotBlank(message="Owner is required") @Size(min=1,max=50,message="Owner must be between 1 and 50 characters") Stringowner()Returns the value of theownerrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TrackerAccountDTO
public TrackerAccountDTO(@NotBlank(message="Owner is required") @Size(min=1,max=50,message="Owner must be between 1 and 50 characters") @NotBlank(message="Owner is required") @Size(min=1,max=50,message="Owner must be between 1 and 50 characters") String owner, @NotBlank(message="Key is required") @Size(min=32,max=64,message="Key must be between 32 and 64 characters") @Pattern(regexp="^[A-Za-z0-9]+$",message="Key must contain only alphanumeric characters") @NotBlank(message="Key is required") @Size(min=32,max=64,message="Key must be between 32 and 64 characters") @Pattern(regexp="^[A-Za-z0-9]+$",message="Key must contain only alphanumeric characters") String key, boolean enabled) Creates an instance of aTrackerAccountDTOrecord class.- Parameters:
owner- the value for theownerrecord componentkey- the value for thekeyrecord componentenabled- the value for theenabledrecord 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 '=='. -
owner
@NotBlank(message="Owner is required") @Size(min=1, max=50, message="Owner must be between 1 and 50 characters") public @NotBlank(message="Owner is required") @Size(min=1,max=50,message="Owner must be between 1 and 50 characters") String owner()Returns the value of theownerrecord component.- Returns:
- the value of the
ownerrecord component
-
key
@NotBlank(message="Key is required") @Size(min=32, max=64, message="Key must be between 32 and 64 characters") @Pattern(regexp="^[A-Za-z0-9]+$", message="Key must contain only alphanumeric characters") public @NotBlank(message="Key is required") @Size(min=32,max=64,message="Key must be between 32 and 64 characters") @Pattern(regexp="^[A-Za-z0-9]+$",message="Key must contain only alphanumeric characters") String key()Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
enabled
public boolean enabled()Returns the value of theenabledrecord component.- Returns:
- the value of the
enabledrecord component
-