Class ImmutableApiKey

  • All Implemented Interfaces:
    ApiKey, Serializable

    @ParametersAreNonnullByDefault
    @Generated("org.immutables.processor.ProxyProcessor")
    @Immutable
    public final class ImmutableApiKey
    extends Object
    implements ApiKey
    Immutable implementation of ApiKey.

    Use the builder to create immutable instances: ImmutableApiKey.builder(). Use the static factory method to create immutable instances: ImmutableApiKey.of().

    See Also:
    Serialized Form
    • Method Detail

      • getClientId

        public String getClientId()
        Specified by:
        getClientId in interface ApiKey
        Returns:
        The value of the clientId attribute
      • withClientId

        public final ImmutableApiKey withClientId​(String value)
        Copy the current immutable object by setting a value for the clientId attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for clientId
        Returns:
        A modified copy of the this object
      • withToken

        public final ImmutableApiKey withToken​(String value)
        Copy the current immutable object by setting a present value for the optional token attribute.
        Parameters:
        value - The value for token
        Returns:
        A modified copy of this object
      • withToken

        public final ImmutableApiKey withToken​(Optional<String> optional)
        Copy the current immutable object by setting an optional value for the token attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for token
        Returns:
        A modified copy of this object
      • withHash

        public final ImmutableApiKey withHash​(String value)
        Copy the current immutable object by setting a present value for the optional hash attribute.
        Parameters:
        value - The value for hash
        Returns:
        A modified copy of this object
      • withHash

        public final ImmutableApiKey withHash​(Optional<String> optional)
        Copy the current immutable object by setting an optional value for the hash attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for hash
        Returns:
        A modified copy of this object
      • withTenantId

        public final ImmutableApiKey withTenantId​(String value)
        Copy the current immutable object by setting a present value for the optional tenantId attribute.
        Parameters:
        value - The value for tenantId
        Returns:
        A modified copy of this object
      • withTenantId

        public final ImmutableApiKey withTenantId​(Optional<String> optional)
        Copy the current immutable object by setting an optional value for the tenantId attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for tenantId
        Returns:
        A modified copy of this object
      • withOwner

        public final ImmutableApiKey withOwner​(String value)
        Copy the current immutable object by setting a present value for the optional owner attribute.
        Parameters:
        value - The value for owner
        Returns:
        A modified copy of this object
      • withOwner

        public final ImmutableApiKey withOwner​(Optional<String> optional)
        Copy the current immutable object by setting an optional value for the owner attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for owner
        Returns:
        A modified copy of this object
      • withCreated

        public final ImmutableApiKey withCreated​(LocalDateTime value)
        Copy the current immutable object by setting a present value for the optional created attribute.
        Parameters:
        value - The value for created
        Returns:
        A modified copy of this object
      • withCreated

        public final ImmutableApiKey withCreated​(Optional<? extends LocalDateTime> optional)
        Copy the current immutable object by setting an optional value for the created attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for created
        Returns:
        A modified copy of this object
      • withStartDateTime

        public final ImmutableApiKey withStartDateTime​(LocalDateTime value)
        Copy the current immutable object by setting a present value for the optional startDateTime attribute.
        Parameters:
        value - The value for startDateTime
        Returns:
        A modified copy of this object
      • withStartDateTime

        public final ImmutableApiKey withStartDateTime​(Optional<? extends LocalDateTime> optional)
        Copy the current immutable object by setting an optional value for the startDateTime attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for startDateTime
        Returns:
        A modified copy of this object
      • withEndDateTime

        public final ImmutableApiKey withEndDateTime​(LocalDateTime value)
        Copy the current immutable object by setting a present value for the optional endDateTime attribute.
        Parameters:
        value - The value for endDateTime
        Returns:
        A modified copy of this object
      • withEndDateTime

        public final ImmutableApiKey withEndDateTime​(Optional<? extends LocalDateTime> optional)
        Copy the current immutable object by setting an optional value for the endDateTime attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for endDateTime
        Returns:
        A modified copy of this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableApiKey that have equal attribute values.
        Overrides:
        equals in class Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: clientId, token, hash, tenantId, owner, created, startDateTime, endDateTime.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

        public String toString()
        Prints the immutable value ApiKey with attribute values.
        Overrides:
        toString in class Object
        Returns:
        A string representation of the value
      • of

        public static ImmutableApiKey of​(String clientId)
        Construct a new immutable ApiKey instance.
        Parameters:
        clientId - The value for the clientId attribute
        Returns:
        An immutable ApiKey instance
      • copyOf

        public static ImmutableApiKey copyOf​(ApiKey instance)
        Creates an immutable copy of a ApiKey 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 ApiKey instance
      • builder

        public static ImmutableApiKey.Builder builder()
        Creates a builder for ImmutableApiKey.
         ImmutableApiKey.builder()
            .clientId(String) // required clientId
            .token(String) // optional token
            .hash(String) // optional hash
            .tenantId(String) // optional tenantId
            .owner(String) // optional owner
            .created(java.time.LocalDateTime) // optional created
            .startDateTime(java.time.LocalDateTime) // optional startDateTime
            .endDateTime(java.time.LocalDateTime) // optional endDateTime
            .build();
         
        Returns:
        A new ImmutableApiKey builder