Package org.apache.iceberg.io
Class ImmutableStorageCredential.Builder
java.lang.Object
org.apache.iceberg.io.ImmutableStorageCredential.Builder
- Enclosing class:
ImmutableStorageCredential
Builds instances of type
ImmutableStorageCredential
.
Initialize attributes and then invoke the build()
method to create an immutable
instance.
Builder
is not thread-safe and generally should not be stored in a field or
collection, but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newImmutableStorageCredential
.Sets or replaces all mappings from the specified map as entries for theconfig
map.from
(StorageCredential instance) Fill a builder with attribute values from the providedStorageCredential
instance.Initializes the value for theprefix
attribute.putAllConfig
(Map<String, ? extends String> entries) Put all mappings from the specified map as entries toconfig
map.Put one entry to theconfig
map.Put one entry to theconfig
map.
-
Method Details
-
from
@CanIgnoreReturnValue public final ImmutableStorageCredential.Builder from(StorageCredential instance) Fill a builder with attribute values from the providedStorageCredential
instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
prefix
Initializes the value for theprefix
attribute.- Parameters:
prefix
- The value for prefix- Returns:
this
builder for use in a chained invocation
-
putConfig
@CanIgnoreReturnValue public final ImmutableStorageCredential.Builder putConfig(String key, String value) Put one entry to theconfig
map.- Parameters:
key
- The key in the config mapvalue
- The associated value in the config map- Returns:
this
builder for use in a chained invocation
-
putConfig
@CanIgnoreReturnValue public final ImmutableStorageCredential.Builder putConfig(Map.Entry<String, ? extends String> entry) Put one entry to theconfig
map. Nulls are not permitted- Parameters:
entry
- The key and value entry- Returns:
this
builder for use in a chained invocation
-
config
@CanIgnoreReturnValue public final ImmutableStorageCredential.Builder config(Map<String, ? extends String> entries) Sets or replaces all mappings from the specified map as entries for theconfig
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the config map- Returns:
this
builder for use in a chained invocation
-
putAllConfig
@CanIgnoreReturnValue public final ImmutableStorageCredential.Builder putAllConfig(Map<String, ? extends String> entries) Put all mappings from the specified map as entries toconfig
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the config map- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableStorageCredential
.- Returns:
- An immutable instance of StorageCredential
- Throws:
IllegalStateException
- if any required attributes are missing
-