# Interface ObjectRetentionOrBuilder (0.33.0)

0.33.0 (latest) 0.31.0 0.28.0 0.27.0 0.25.0 0.23.0 0.22.0 0.20.0 0.18.0 0.16.0 0.15.0 0.14.0 0.13.0 0.12.0 0.10.0 0.8.0 0.7.0 0.4.0 0.3.0 0.2.0

    public interface ObjectRetentionOrBuilder extends MessageOrBuilder

## Implements

[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)

## Methods

### getRetainUntilTime()

    public abstract String getRetainUntilTime()

Required. The time when the object will be retained until. UNSET will clear
the retention. Must be specified in RFC 3339 format e.g.
YYYY-MM-DD'T'HH:MM:SS.SS'Z' or YYYY-MM-DD'T'HH:MM:SS'Z'.

`optional string retain_until_time = 1 [(.google.api.field_behavior) = REQUIRED];`

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

### getRetainUntilTimeBytes()

    public abstract ByteString getRetainUntilTimeBytes()

Required. The time when the object will be retained until. UNSET will clear
the retention. Must be specified in RFC 3339 format e.g.
YYYY-MM-DD'T'HH:MM:SS.SS'Z' or YYYY-MM-DD'T'HH:MM:SS'Z'.

`optional string retain_until_time = 1 [(.google.api.field_behavior) = REQUIRED];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for retainUntilTime. |

### getRetentionMode()

    public abstract ObjectRetention.RetentionMode getRetentionMode()

Required. The retention mode of the object.

`
optional .google.cloud.storagebatchoperations.v1.ObjectRetention.RetentionMode retention_mode = 2 [(.google.api.field_behavior) = REQUIRED];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-storagebatchoperations/latest/com.google.cloud.storagebatchoperations.v1.ObjectRetention.RetentionMode` | The retentionMode. |

### getRetentionModeValue()

    public abstract int getRetentionModeValue()

Required. The retention mode of the object.

`
optional .google.cloud.storagebatchoperations.v1.ObjectRetention.RetentionMode retention_mode = 2 [(.google.api.field_behavior) = REQUIRED];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The enum numeric value on the wire for retentionMode. |

### hasRetainUntilTime()

    public abstract boolean hasRetainUntilTime()

Required. The time when the object will be retained until. UNSET will clear
the retention. Must be specified in RFC 3339 format e.g.
YYYY-MM-DD'T'HH:MM:SS.SS'Z' or YYYY-MM-DD'T'HH:MM:SS'Z'.

`optional string retain_until_time = 1 [(.google.api.field_behavior) = REQUIRED];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the retainUntilTime field is set. |

### hasRetentionMode()

    public abstract boolean hasRetentionMode()

Required. The retention mode of the object.

`
optional .google.cloud.storagebatchoperations.v1.ObjectRetention.RetentionMode retention_mode = 2 [(.google.api.field_behavior) = REQUIRED];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the retentionMode field is set. |