Package com.spotify.github.v3.checks
Class ImmutableAccessToken
- java.lang.Object
-
- com.spotify.github.v3.checks.ImmutableAccessToken
-
- All Implemented Interfaces:
AccessToken
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableAccessToken extends Object implements AccessToken
Immutable implementation ofAccessToken.Use the builder to create immutable instances:
ImmutableAccessToken.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableAccessToken.BuilderBuilds instances of typeImmutableAccessToken.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableAccessToken.Builderbuilder()Creates a builder forImmutableAccessToken.static ImmutableAccessTokencopyOf(AccessToken instance)Creates an immutable copy of aAccessTokenvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableAccessTokenthat have equal attribute values.ZonedDateTimeexpiresAt()Token expiration date.inthashCode()Computes a hash code from attributes:token,expiresAt.Stringtoken()Access Token.StringtoString()Prints the immutable valueAccessTokenwith attribute values.ImmutableAccessTokenwithExpiresAt(ZonedDateTime value)Copy the current immutable object by setting a value for theexpiresAtattribute.ImmutableAccessTokenwithToken(String value)Copy the current immutable object by setting a value for thetokenattribute.
-
-
-
Method Detail
-
token
public String token()
Access Token.- Specified by:
tokenin interfaceAccessToken- Returns:
- the token content
-
expiresAt
public ZonedDateTime expiresAt()
Token expiration date.- Specified by:
expiresAtin interfaceAccessToken- Returns:
- the zoned date time
-
withToken
public final ImmutableAccessToken withToken(String value)
Copy the current immutable object by setting a value for thetokenattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for token- Returns:
- A modified copy of the
thisobject
-
withExpiresAt
public final ImmutableAccessToken withExpiresAt(ZonedDateTime value)
Copy the current immutable object by setting a value for theexpiresAtattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for expiresAt- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableAccessTokenthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:token,expiresAt.
-
toString
public String toString()
Prints the immutable valueAccessTokenwith attribute values.
-
copyOf
public static ImmutableAccessToken copyOf(AccessToken instance)
Creates an immutable copy of aAccessTokenvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable AccessToken instance
-
builder
public static ImmutableAccessToken.Builder builder()
Creates a builder forImmutableAccessToken.ImmutableAccessToken.builder() .token(String) // requiredtoken.expiresAt(java.time.ZonedDateTime) // requiredexpiresAt.build();- Returns:
- A new ImmutableAccessToken builder
-
-