Record Class StreakResponse
java.lang.Object
java.lang.Record
org.ntnu.idi.idatt2106.sparesti.sparestibackend.dto.user.StreakResponse
- Record Components:
streakStart
- Streak start datestreak
- StreakfirstDue
- Date when streak resets
- All Implemented Interfaces:
Serializable
public record StreakResponse(ZonedDateTime streakStart, @PositiveOrZero Long streak, ZonedDateTime firstDue)
extends Record
implements Serializable
DTO for
User
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionStreakResponse
(ZonedDateTime streakStart, @PositiveOrZero Long streak, ZonedDateTime firstDue) Creates an instance of aStreakResponse
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.firstDue()
Returns the value of thefirstDue
record component.final int
hashCode()
Returns a hash code value for this object.@PositiveOrZero Long
streak()
Returns the value of thestreak
record component.Returns the value of thestreakStart
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
StreakResponse
public StreakResponse(ZonedDateTime streakStart, @PositiveOrZero @PositiveOrZero Long streak, ZonedDateTime firstDue) Creates an instance of aStreakResponse
record class.- Parameters:
streakStart
- the value for thestreakStart
record componentstreak
- the value for thestreak
record componentfirstDue
- the value for thefirstDue
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)
. -
streakStart
Returns the value of thestreakStart
record component.- Returns:
- the value of the
streakStart
record component
-
streak
Returns the value of thestreak
record component.- Returns:
- the value of the
streak
record component
-
firstDue
Returns the value of thefirstDue
record component.- Returns:
- the value of the
firstDue
record component
-