Package web.sportflow.challenge
Record Class ChallengeDto
java.lang.Object
java.lang.Record
web.sportflow.challenge.ChallengeDto
-
Constructor Summary
ConstructorsConstructorDescriptionChallengeDto(double currentValue, double targetValue, int percentage, boolean completed, String unitLabel) Creates an instance of aChallengeDtorecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of thecompletedrecord component.doubleReturns the value of thecurrentValuerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of thepercentagerecord component.doubleReturns the value of thetargetValuerecord component.final StringtoString()Returns a string representation of this record class.Returns the value of theunitLabelrecord component.
-
Constructor Details
-
ChallengeDto
public ChallengeDto(double currentValue, double targetValue, int percentage, boolean completed, String unitLabel) Creates an instance of aChallengeDtorecord class.- Parameters:
currentValue- the value for thecurrentValuerecord componenttargetValue- the value for thetargetValuerecord componentpercentage- the value for thepercentagerecord componentcompleted- the value for thecompletedrecord componentunitLabel- the value for theunitLabelrecord 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 '=='. -
currentValue
public double currentValue()Returns the value of thecurrentValuerecord component.- Returns:
- the value of the
currentValuerecord component
-
targetValue
public double targetValue()Returns the value of thetargetValuerecord component.- Returns:
- the value of the
targetValuerecord component
-
percentage
public int percentage()Returns the value of thepercentagerecord component.- Returns:
- the value of the
percentagerecord component
-
completed
public boolean completed()Returns the value of thecompletedrecord component.- Returns:
- the value of the
completedrecord component
-
unitLabel
Returns the value of theunitLabelrecord component.- Returns:
- the value of the
unitLabelrecord component
-