Record Class ChallengeConfigDTO
java.lang.Object
java.lang.Record
org.ntnu.idi.idatt2106.sparesti.sparestibackend.dto.config.ChallengeConfigDTO
- Record Components:
experience
- Experiencemotivation
- MotivationchallengeTypeConfigs
- List of challenge type configs
- All Implemented Interfaces:
Serializable
public record ChallengeConfigDTO(@NotNull(message="Experience cannot be null") Experience experience, @NotNull(message="Motivation cannot be null") Motivation motivation, @NotNull(message="Challenge type configurations cannot be null") @Size(min=1,message="At least one challenge type configuration is required") Set<ChallengeTypeConfigDTO> challengeTypeConfigs)
extends Record
implements Serializable
DTO for
ChallengeConfig
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionChallengeConfigDTO
(@NotNull(message="Experience cannot be null") Experience experience, @NotNull(message="Motivation cannot be null") Motivation motivation, @NotNull(message="Challenge type configurations cannot be null") @Size(min=1,message="At least one challenge type configuration is required") Set<ChallengeTypeConfigDTO> challengeTypeConfigs) Creates an instance of aChallengeConfigDTO
record class. -
Method Summary
Modifier and TypeMethodDescription@NotNull(message="Challenge type configurations cannot be null") @Size(min=1,message="At least one challenge type configuration is required") Set
<ChallengeTypeConfigDTO> Returns the value of thechallengeTypeConfigs
record component.final boolean
Indicates whether some other object is "equal to" this one.@NotNull(message="Experience cannot be null") Experience
Returns the value of theexperience
record component.final int
hashCode()
Returns a hash code value for this object.@NotNull(message="Motivation cannot be null") Motivation
Returns the value of themotivation
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
ChallengeConfigDTO
public ChallengeConfigDTO(@NotNull(message="Experience cannot be null") @NotNull(message="Experience cannot be null") Experience experience, @NotNull(message="Motivation cannot be null") @NotNull(message="Motivation cannot be null") Motivation motivation, @NotNull(message="Challenge type configurations cannot be null") @Size(min=1,message="At least one challenge type configuration is required") @NotNull(message="Challenge type configurations cannot be null") @Size(min=1,message="At least one challenge type configuration is required") Set<ChallengeTypeConfigDTO> challengeTypeConfigs) Creates an instance of aChallengeConfigDTO
record class.- Parameters:
experience
- the value for theexperience
record componentmotivation
- the value for themotivation
record componentchallengeTypeConfigs
- the value for thechallengeTypeConfigs
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)
. -
experience
@NotNull(message="Experience cannot be null") public @NotNull(message="Experience cannot be null") Experience experience()Returns the value of theexperience
record component.- Returns:
- the value of the
experience
record component
-
motivation
@NotNull(message="Motivation cannot be null") public @NotNull(message="Motivation cannot be null") Motivation motivation()Returns the value of themotivation
record component.- Returns:
- the value of the
motivation
record component
-
challengeTypeConfigs
@NotNull(message="Challenge type configurations cannot be null") @Size(min=1, message="At least one challenge type configuration is required") public @NotNull(message="Challenge type configurations cannot be null") @Size(min=1,message="At least one challenge type configuration is required") Set<ChallengeTypeConfigDTO> challengeTypeConfigs()Returns the value of thechallengeTypeConfigs
record component.- Returns:
- the value of the
challengeTypeConfigs
record component
-