Record Class UserConfigDTO
java.lang.Object
java.lang.Record
org.ntnu.idi.idatt2106.sparesti.sparestibackend.dto.config.UserConfigDTO
- Record Components:
role- Role of userchallengeConfig- Challenge configuration for user
- All Implemented Interfaces:
Serializable
public record UserConfigDTO(@NotNull(message="Role cannot be null") Role role, @NotNull(message="Challenge config cannot be null") ChallengeConfigDTO challengeConfig)
extends Record
implements Serializable
DTO for
UserConfig- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionUserConfigDTO(@NotNull(message="Role cannot be null") Role role, @NotNull(message="Challenge config cannot be null") ChallengeConfigDTO challengeConfig) Creates an instance of aUserConfigDTOrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull(message="Challenge config cannot be null") ChallengeConfigDTOReturns the value of thechallengeConfigrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull(message="Role cannot be null") Rolerole()Returns the value of therolerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
UserConfigDTO
public UserConfigDTO(@NotNull(message="Role cannot be null") @NotNull(message="Role cannot be null") Role role, @NotNull(message="Challenge config cannot be null") @NotNull(message="Challenge config cannot be null") ChallengeConfigDTO challengeConfig) Creates an instance of aUserConfigDTOrecord class.- Parameters:
role- the value for therolerecord componentchallengeConfig- the value for thechallengeConfigrecord 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. All components in this record class are compared withObjects::equals(Object,Object). -
role
Returns the value of therolerecord component.- Returns:
- the value of the
rolerecord component
-
challengeConfig
@NotNull(message="Challenge config cannot be null") public @NotNull(message="Challenge config cannot be null") ChallengeConfigDTO challengeConfig()Returns the value of thechallengeConfigrecord component.- Returns:
- the value of the
challengeConfigrecord component
-