# Class BucketInfo (2.69.0)

2.69.0 (latest) 2.67.0 2.64.0 2.63.0 2.62.1 2.60.0 2.59.0 2.58.1 2.57.0 2.56.0 2.55.0 2.54.0 2.53.3 2.52.3 2.50.0 2.49.0 2.48.2 2.47.0 2.46.0 2.45.0 2.44.1 2.43.2 2.42.0 2.41.0 2.40.1 2.39.0 2.38.0 2.37.0 2.36.1 2.34.0 2.33.0 2.32.1 2.30.1 2.29.1 2.28.0 2.27.1 2.24.0 2.23.0 2.22.6 2.21.0 2.20.2 2.19.0 2.18.0 2.17.2 2.16.0 2.15.1 2.14.0 2.13.1 2.12.0 2.11.3 2.10.0 2.9.3 2.8.1 2.7.1 2.6.1 2.5.1 2.4.5 2.3.0 2.2.3 2.1.10

    public class BucketInfo implements Serializable

Google Storage bucket metadata;
See Also: [Concepts and Terminology](https://cloud.google.com/storage/docs/concepts-techniques#concepts)

## Inheritance

[Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> BucketInfo

## Implements

[Serializable](https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html)

## Inherited Members

[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) [Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) [Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) [Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) [Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) [Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) [Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) [Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)

## Static Methods

### newBuilder(String name)

    public static BucketInfo.Builder newBuilder(String name)

Returns a `BucketInfo` builder where the bucket's name is set to the provided name.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.BucketInfo.Builder` |   |

### of(String name)

    public static BucketInfo of(String name)

Creates a `BucketInfo` object for the provided bucket name.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.BucketInfo` |   |

## Methods

### equals(Object o)

    public boolean equals(Object o)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `o` | `https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

**Overrides** [Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-)

### getAcl()

    public List<Acl> getAcl()

Returns the bucket's access control configuration.
See Also: [About Access Control Lists](https://cloud.google.com/storage/docs/access-control#About-Access-Control-Lists)

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Acl>` |   |

### getAutoclass()

    public BucketInfo.Autoclass getAutoclass()

Returns the Autoclass configuration

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.BucketInfo.Autoclass` |   |

### getCors()

    public List<Cors> getCors()

Returns the bucket's Cross-Origin Resource Sharing (CORS) configuration.
See Also: [Cross-Origin Resource Sharing (CORS)](https://cloud.google.com/storage/docs/cross-origin)

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Cors>` |   |

### getCreateTime() (deprecated)

    public Long getCreateTime()

**Deprecated.** *[#getCreateTimeOffsetDateTime()](https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.BucketInfo#com_google_cloud_storage_BucketInfo_getCreateTimeOffsetDateTime__)*

Returns the time at which the bucket was created.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html` |   |

### getCreateTimeOffsetDateTime()

    public OffsetDateTime getCreateTimeOffsetDateTime()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html` |   |

### getCustomPlacementConfig()

    public BucketInfo.CustomPlacementConfig getCustomPlacementConfig()

Returns the Custom Placement Configuration

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.BucketInfo.CustomPlacementConfig` |   |

### getCustomerManagedEncryptionEnforcementConfig()

    public @Nullable BucketInfo.CustomerManagedEncryptionEnforcementConfig getCustomerManagedEncryptionEnforcementConfig()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `@org.checkerframework.checker.nullness.qual.Nullable com.google.cloud.storage.BucketInfo.CustomerManagedEncryptionEnforcementConfig` |   |

### getCustomerSuppliedEncryptionEnforcementConfig()

    public @Nullable BucketInfo.CustomerSuppliedEncryptionEnforcementConfig getCustomerSuppliedEncryptionEnforcementConfig()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `@org.checkerframework.checker.nullness.qual.Nullable com.google.cloud.storage.BucketInfo.CustomerSuppliedEncryptionEnforcementConfig` |   |

### getDefaultAcl()

    public List<Acl> getDefaultAcl()

Returns the default access control configuration for this bucket's blobs.
See Also: [About Access Control Lists](https://cloud.google.com/storage/docs/access-control#About-Access-Control-Lists)

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Acl>` |   |

### getDefaultEventBasedHold()

    public Boolean getDefaultEventBasedHold()

> [!WARNING]
> **Beta**
>
> This feature is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1) of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the launch stage descriptions.

Returns a `Boolean` with either `true`, `null` and in certain cases `
false`.

Case 1: `true` the field [com.google.cloud.storage.Storage.BucketField#DEFAULT_EVENT_BASED_HOLD](https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Storage.BucketField#com_google_cloud_storage_Storage_BucketField_DEFAULT_EVENT_BASED_HOLD) is selected in a [Storage#get(String, Storage.BucketGetOption...)](https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Storage#com_google_cloud_storage_Storage_get_) and default event-based hold for the bucket is
enabled.

Case 2.1: `null` the field [com.google.cloud.storage.Storage.BucketField#DEFAULT_EVENT_BASED_HOLD](https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Storage.BucketField#com_google_cloud_storage_Storage_BucketField_DEFAULT_EVENT_BASED_HOLD) is selected in a [Storage#get(String, Storage.BucketGetOption...)](https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Storage#com_google_cloud_storage_Storage_get_), but default event-based hold for the bucket
is not enabled. This case can be considered implicitly `false`.

Case 2.2: `null` the field [com.google.cloud.storage.Storage.BucketField#DEFAULT_EVENT_BASED_HOLD](https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Storage.BucketField#com_google_cloud_storage_Storage_BucketField_DEFAULT_EVENT_BASED_HOLD) is not selected in a
[Storage#get(String, Storage.BucketGetOption...)](https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Storage#com_google_cloud_storage_Storage_get_), and the state for this field is
unknown.

Case 3: `false` default event-based hold is explicitly set to false using in a Builder#setDefaultEventBasedHold(Boolean) client side for a follow-up request e.g. [Storage#update(BucketInfo, Storage.BucketTargetOption...)](https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Storage#com_google_cloud_storage_Storage_update_) in which case the value of default
event-based hold will remain `false` for the given instance.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html` |   |

### getDefaultKmsKeyName()

    public String getDefaultKmsKeyName()

Returns the default Cloud KMS key to be applied to newly inserted objects in this bucket.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getDeleteRules() (deprecated)

    public List<? extends BucketInfo.DeleteRule> getDeleteRules()

Returns bucket's lifecycle configuration as a number of delete rules.
See Also: [Lifecycle Management](https://cloud.google.com/storage/docs/lifecycle)

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<? extends com.google.cloud.storage.BucketInfo.DeleteRule>` |   |

### getEtag()

    public String getEtag()

Returns HTTP 1.1 Entity tag for the bucket.
See Also: [Entity Tags](http://tools.ietf.org/html/rfc2616#section-3.11)

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getGeneratedId()

    public String getGeneratedId()

Returns the service-generated id for the bucket.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getGoogleManagedEncryptionEnforcementConfig()

    public @Nullable BucketInfo.GoogleManagedEncryptionEnforcementConfig getGoogleManagedEncryptionEnforcementConfig()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `@org.checkerframework.checker.nullness.qual.Nullable com.google.cloud.storage.BucketInfo.GoogleManagedEncryptionEnforcementConfig` |   |

### getHierarchicalNamespace()

    public BucketInfo.HierarchicalNamespace getHierarchicalNamespace()

Returns the Hierarchical Namespace (Folders) Configuration

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.BucketInfo.HierarchicalNamespace` |   |

### getIamConfiguration()

    public BucketInfo.IamConfiguration getIamConfiguration()

> [!WARNING]
> **Beta**
>
> This feature is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1) of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the launch stage descriptions.

Returns the IAM configuration

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.BucketInfo.IamConfiguration` |   |

### getIndexPage()

    public String getIndexPage()

Returns bucket's website index page. Behaves as the bucket's directory index where missing
blobs are treated as potential directories.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getIpFilter()

    public @Nullable BucketInfo.IpFilter getIpFilter()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `@org.checkerframework.checker.nullness.qual.Nullable com.google.cloud.storage.BucketInfo.IpFilter` |   |

### getLabels()

    public @Nullable Map<@NonNull String,@Nullable String> getLabels()

Returns the labels for this bucket.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `@org.checkerframework.checker.nullness.qual.Nullable java.util.Map<@org.checkerframework.checker.nullness.qual.NonNull java.lang.String,@org.checkerframework.checker.nullness.qual.Nullable java.lang.String>` |   |

### getLifecycleRules()

    public @NonNull List<? extends BucketInfo.LifecycleRule> getLifecycleRules()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `@org.checkerframework.checker.nullness.qual.NonNull java.util.List<? extends com.google.cloud.storage.BucketInfo.LifecycleRule>` |   |

### getLocation()

    public String getLocation()

Returns the bucket's location. Data for blobs in the bucket resides in physical storage within
this region or regions. If specifying more than one region `customPlacementConfig` should be
set in conjunction.
See Also: [Bucket Locations](https://cloud.google.com/storage/docs/bucket-locations)

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getLocationType()

    public String getLocationType()

Returns the bucket's locationType.
See Also: [Bucket LocationType](https://cloud.google.com/storage/docs/bucket-locations)

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getLogging()

    public BucketInfo.Logging getLogging()

Returns the Logging

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.BucketInfo.Logging` |   |

### getMetageneration()

    public Long getMetageneration()

Returns the metadata generation of this bucket.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html` |   |

### getName()

    public String getName()

Returns the bucket's name.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getNotFoundPage()

    public String getNotFoundPage()

Returns the custom object to return when a requested resource is not found.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getObjectRetention()

    public BucketInfo.ObjectRetention getObjectRetention()

returns the Object Retention configuration

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.BucketInfo.ObjectRetention` |   |

### getOwner()

    public Acl.Entity getOwner()

Returns the bucket's owner. This is always the project team's owner group.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Acl.Entity` |   |

### getProject()

    public BigInteger getProject()

The project number of the project the bucket belongs to

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/math/BigInteger.html` |   |

### getRetentionEffectiveTime() (deprecated)

    public Long getRetentionEffectiveTime()

> [!WARNING]
> **Beta**
>
> This feature is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1) of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the launch stage descriptions.

**Deprecated.** *Use [#getRetentionPeriodDuration()](https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.BucketInfo#com_google_cloud_storage_BucketInfo_getRetentionPeriodDuration__)*

Returns the retention effective time a policy took effect if a retention policy is defined as a
`Long`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html` |   |

### getRetentionEffectiveTimeOffsetDateTime()

    public OffsetDateTime getRetentionEffectiveTimeOffsetDateTime()

> [!WARNING]
> **Beta**
>
> This feature is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1) of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the launch stage descriptions.

Returns the retention effective time a policy took effect if a retention policy is defined.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html` |   |

### getRetentionPeriod() (deprecated)

    public Long getRetentionPeriod()

> [!WARNING]
> **Beta**
>
> This feature is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1) of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the launch stage descriptions.

**Deprecated.** *Use [#getRetentionPeriodDuration()](https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.BucketInfo#com_google_cloud_storage_BucketInfo_getRetentionPeriodDuration__)*

Returns the retention policy retention period.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html` |   |

### getRetentionPeriodDuration()

    public Duration getRetentionPeriodDuration()

> [!WARNING]
> **Beta**
>
> This feature is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1) of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the launch stage descriptions.

Returns the retention policy retention period.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html` |   |

### getRpo()

    public Rpo getRpo()

Returns the bucket's recovery point objective (RPO). This defines how quickly data is
replicated between regions in a dual-region bucket. Not defined for single-region buckets.
See Also: [Turbo Replication"](https://cloud.google.com/storage/docs/turbo-replication)

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Rpo` |   |

### getSelfLink()

    public String getSelfLink()

Returns the URI of this bucket as a string.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

### getSoftDeletePolicy()

    public BucketInfo.SoftDeletePolicy getSoftDeletePolicy()

returns the Soft Delete policy

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.BucketInfo.SoftDeletePolicy` |   |

### getStorageClass()

    public StorageClass getStorageClass()

Returns the bucket's storage class. This defines how blobs in the bucket are stored and
determines the SLA and the cost of storage.
See Also: [Storage Classes](https://cloud.google.com/storage/docs/storage-classes)

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.StorageClass` |   |

### getUpdateTime() (deprecated)

    public Long getUpdateTime()

**Deprecated.** *[#getUpdateTimeOffsetDateTime()](https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.BucketInfo#com_google_cloud_storage_BucketInfo_getUpdateTimeOffsetDateTime__)*

Returns the last modification time of the bucket's metadata expressed as the number of
milliseconds since the Unix epoch.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html` |   |

### getUpdateTimeOffsetDateTime()

    public OffsetDateTime getUpdateTimeOffsetDateTime()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html` |   |

### hashCode()

    public int hashCode()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

**Overrides** [Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--)

### isUnreachable()

    public Boolean isUnreachable()

Returns a `Boolean` with `true` if the bucket is unreachable, else `null`

A bucket may be unreachable if the region in which it resides is experiencing an outage or
if there are other temporary access issues.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html` |   |

### requesterPays()

    public Boolean requesterPays()

Returns a `Boolean` with either `true`, `false`, and in a specific case
`null`.

Case 1: `true` the field [com.google.cloud.storage.Storage.BucketField#BILLING](https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Storage.BucketField#com_google_cloud_storage_Storage_BucketField_BILLING)
is selected in a [Storage#get(String, Storage.BucketGetOption...)](https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Storage#com_google_cloud_storage_Storage_get_) and requester pays for
the bucket is enabled.

Case 2: `false` the field [com.google.cloud.storage.Storage.BucketField#BILLING](https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Storage.BucketField#com_google_cloud_storage_Storage_BucketField_BILLING)
in a [Storage#get(String, Storage.BucketGetOption...)](https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Storage#com_google_cloud_storage_Storage_get_) is selected and requester pays for
the bucket is disable.

Case 3: `null` the field [com.google.cloud.storage.Storage.BucketField#BILLING](https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Storage.BucketField#com_google_cloud_storage_Storage_BucketField_BILLING)
in a [Storage#get(String, Storage.BucketGetOption...)](https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Storage#com_google_cloud_storage_Storage_get_) is not selected, the value is
unknown.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html` |   |

### retentionPolicyIsLocked()

    public Boolean retentionPolicyIsLocked()

> [!WARNING]
> **Beta**
>
> This feature is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1) of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the launch stage descriptions.

Returns a `Boolean` with either `true` or `null`.

Case 1: `true` the field [com.google.cloud.storage.Storage.BucketField#RETENTION_POLICY](https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Storage.BucketField#com_google_cloud_storage_Storage_BucketField_RETENTION_POLICY) is selected in a [Storage#get(String, Storage.BucketGetOption...)](https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Storage#com_google_cloud_storage_Storage_get_) and retention policy for the bucket is locked.

Case 2.1: `null` the field [com.google.cloud.storage.Storage.BucketField#RETENTION_POLICY](https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Storage.BucketField#com_google_cloud_storage_Storage_BucketField_RETENTION_POLICY) is selected in a [Storage#get(String, Storage.BucketGetOption...)](https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Storage#com_google_cloud_storage_Storage_get_), but retention policy for the bucket is not
locked. This case can be considered implicitly `false`.

Case 2.2: `null` the field [com.google.cloud.storage.Storage.BucketField#RETENTION_POLICY](https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Storage.BucketField#com_google_cloud_storage_Storage_BucketField_RETENTION_POLICY) is not selected in a [Storage#get(String, Storage.BucketGetOption...)](https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Storage#com_google_cloud_storage_Storage_get_), and the state for this field is unknown.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html` |   |

### toBuilder()

    public BucketInfo.Builder toBuilder()

Returns a builder for the current bucket.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.BucketInfo.Builder` |   |

### toString()

    public String toString()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` |   |

**Overrides** [Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--)

### versioningEnabled()

    public Boolean versioningEnabled()

Returns a `Boolean` with either `true`, `null` and in certain cases `
false`.

Case 1: `true` the field [com.google.cloud.storage.Storage.BucketField#VERSIONING](https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Storage.BucketField#com_google_cloud_storage_Storage_BucketField_VERSIONING) is selected in a [Storage#get(String, Storage.BucketGetOption...)](https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Storage#com_google_cloud_storage_Storage_get_) and versions for the bucket is enabled.

Case 2.1: `null` the field [com.google.cloud.storage.Storage.BucketField#VERSIONING](https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Storage.BucketField#com_google_cloud_storage_Storage_BucketField_VERSIONING) is selected in a [Storage#get(String, Storage.BucketGetOption...)](https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Storage#com_google_cloud_storage_Storage_get_), but versions for the bucket is not enabled.
This case can be considered implicitly `false`.

Case 2.2: `null` the field [com.google.cloud.storage.Storage.BucketField#VERSIONING](https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Storage.BucketField#com_google_cloud_storage_Storage_BucketField_VERSIONING) is not selected in a [Storage#get(String, Storage.BucketGetOption...)](https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Storage#com_google_cloud_storage_Storage_get_), and the state for this field is unknown.

Case 3: `false` versions is explicitly set to false client side for a follow-up
request for example [Storage#update(BucketInfo, Storage.BucketTargetOption...)](https://docs.cloud.google.com/java/docs/reference/google-cloud-storage/latest/com.google.cloud.storage.Storage#com_google_cloud_storage_Storage_update_) in which
case the value of versions will remain `false` for for the given instance.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/Boolean.html` |   |