Class ImmutableStorageCredential

java.lang.Object
org.apache.iceberg.io.ImmutableStorageCredential
All Implemented Interfaces:
Serializable, StorageCredential

@ParametersAreNonnullByDefault @Immutable @CheckReturnValue public final class ImmutableStorageCredential extends Object implements StorageCredential
This was copied from the generated Immutable implementation of StorageCredential with the one difference that the underlying Map is not unmodifiable but rather a SerializableMap so that Ser/De properly works with Kryo.

Use the builder to create immutable instances: ImmutableStorageCredential.builder().

See Also:
  • Method Details

    • prefix

      public String prefix()
      Specified by:
      prefix in interface StorageCredential
      Returns:
      The value of the prefix attribute
    • config

      public Map<String,String> config()
      Specified by:
      config in interface StorageCredential
      Returns:
      The value of the config attribute
    • withPrefix

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

      public final ImmutableStorageCredential withConfig(Map<String,? extends String> entries)
      Copy the current immutable object by replacing the config map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      entries - The entries to be added to the config map
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableStorageCredential 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: prefix, config.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableStorageCredential.Builder builder()
      Creates a builder for ImmutableStorageCredential.
       ImmutableStorageCredential.builder()
          .prefix(String) // required prefix
          .putConfig|putAllConfig(String => String) // config mappings
          .build();
       
      Returns:
      A new ImmutableStorageCredential builder