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 aUserConfigDTO
record class. -
Method Summary
Modifier and TypeMethodDescription@NotNull(message="Challenge config cannot be null") ChallengeConfigDTO
Returns the value of thechallengeConfig
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.@NotNull(message="Role cannot be null") Role
role()
Returns the value of therole
record component.final String
toString()
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 aUserConfigDTO
record class.- Parameters:
role
- the value for therole
record componentchallengeConfig
- the value for thechallengeConfig
record 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 therole
record component.- Returns:
- the value of the
role
record component
-
challengeConfig
@NotNull(message="Challenge config cannot be null") public @NotNull(message="Challenge config cannot be null") ChallengeConfigDTO challengeConfig()Returns the value of thechallengeConfig
record component.- Returns:
- the value of the
challengeConfig
record component
-