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 class
ImmutableAccessToken.Builder
Builds instances of typeImmutableAccessToken
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableAccessToken.Builder
builder()
Creates a builder forImmutableAccessToken
.static ImmutableAccessToken
copyOf(AccessToken instance)
Creates an immutable copy of aAccessToken
value.boolean
equals(Object another)
This instance is equal to all instances ofImmutableAccessToken
that have equal attribute values.ZonedDateTime
expiresAt()
Token expiration date.int
hashCode()
Computes a hash code from attributes:token
,expiresAt
.String
token()
Access Token.String
toString()
Prints the immutable valueAccessToken
with attribute values.ImmutableAccessToken
withExpiresAt(ZonedDateTime value)
Copy the current immutable object by setting a value for theexpiresAt
attribute.ImmutableAccessToken
withToken(String value)
Copy the current immutable object by setting a value for thetoken
attribute.
-
-
-
Method Detail
-
token
public String token()
Access Token.- Specified by:
token
in interfaceAccessToken
- Returns:
- the token content
-
expiresAt
public ZonedDateTime expiresAt()
Token expiration date.- Specified by:
expiresAt
in interfaceAccessToken
- Returns:
- the zoned date time
-
withToken
public final ImmutableAccessToken withToken(String value)
Copy the current immutable object by setting a value for thetoken
attribute. 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
this
object
-
withExpiresAt
public final ImmutableAccessToken withExpiresAt(ZonedDateTime value)
Copy the current immutable object by setting a value for theexpiresAt
attribute. 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
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableAccessToken
that have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:token
,expiresAt
.
-
toString
public String toString()
Prints the immutable valueAccessToken
with attribute values.
-
copyOf
public static ImmutableAccessToken copyOf(AccessToken instance)
Creates an immutable copy of aAccessToken
value. 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) // required
token
.expiresAt(java.time.ZonedDateTime) // requiredexpiresAt
.build();- Returns:
- A new ImmutableAccessToken builder
-
-