Record Class Subscription
java.lang.Object
java.lang.Record
com.mojang.realmsclient.dto.Subscription
public record Subscription(Instant startDate, int daysLeft, Subscription.SubscriptionType type)
extends Record
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe field for thedaysLeftrecord component.private static final org.slf4j.Loggerprivate final InstantThe field for thestartDaterecord component.private final Subscription.SubscriptionTypeThe field for thetyperecord component. -
Constructor Summary
ConstructorsConstructorDescriptionSubscription(Instant startDate, int daysLeft, Subscription.SubscriptionType type) Creates an instance of aSubscriptionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintdaysLeft()Returns the value of thedaysLeftrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static SubscriptionReturns the value of thestartDaterecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.private static Subscription.SubscriptionType
-
Field Details
-
startDate
The field for thestartDaterecord component. -
daysLeft
private final int daysLeftThe field for thedaysLeftrecord component. -
type
The field for thetyperecord component. -
LOGGER
private static final org.slf4j.Logger LOGGER
-
-
Constructor Details
-
Subscription
Creates an instance of aSubscriptionrecord class.- Parameters:
startDate- the value for thestartDaterecord componentdaysLeft- the value for thedaysLeftrecord componenttype- the value for thetyperecord component
-
-
Method Details
-
parse
-
typeFrom
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
startDate
Returns the value of thestartDaterecord component.- Returns:
- the value of the
startDaterecord component
-
daysLeft
public int daysLeft()Returns the value of thedaysLeftrecord component.- Returns:
- the value of the
daysLeftrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-