Send feedback
Class ObjectRetention.Builder (0.22.0)
Stay organized with collections
Save and categorize content based on your preferences.
Version latestkeyboard_arrow_down
public static final class ObjectRetention . Builder extends GeneratedMessageV3 . Builder<ObjectRetention . Builder > implements ObjectRetentionOrBuilder
Describes options for object retention update.
Protobuf type google.cloud.storagebatchoperations.v1.ObjectRetention
Inherited Members
com.google.protobuf.GeneratedMessageV3.Builder.getUnknownFieldSetBuilder()
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownLengthDelimitedField(int,com.google.protobuf.ByteString)
com.google.protobuf.GeneratedMessageV3.Builder.mergeUnknownVarintField(int,int)
com.google.protobuf.GeneratedMessageV3.Builder.parseUnknownField(com.google.protobuf.CodedInputStream,com.google.protobuf.ExtensionRegistryLite,int)
com.google.protobuf.GeneratedMessageV3.Builder.setUnknownFieldSetBuilder(com.google.protobuf.UnknownFieldSet.Builder)
Static Methods
getDescriptor()
public static final Descriptors . Descriptor getDescriptor ()
Methods
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public ObjectRetention . Builder addRepeatedField ( Descriptors . FieldDescriptor field , Object value )
Overrides
build()
public ObjectRetention build ()
buildPartial()
public ObjectRetention buildPartial ()
clear()
public ObjectRetention . Builder clear ()
Overrides
clearField(Descriptors.FieldDescriptor field)
public ObjectRetention . Builder clearField ( Descriptors . FieldDescriptor field )
Overrides
clearOneof(Descriptors.OneofDescriptor oneof)
public ObjectRetention . Builder clearOneof ( Descriptors . OneofDescriptor oneof )
Overrides
clearRetainUntilTime()
public ObjectRetention . Builder clearRetainUntilTime ()
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];
clearRetentionMode()
public ObjectRetention . Builder clearRetentionMode ()
Required. The retention mode of the object.
optional .google.cloud.storagebatchoperations.v1.ObjectRetention.RetentionMode retention_mode = 2 [(.google.api.field_behavior) = REQUIRED];
clone()
public ObjectRetention . Builder clone ()
Overrides
getDefaultInstanceForType()
public ObjectRetention getDefaultInstanceForType ()
getDescriptorForType()
public Descriptors . Descriptor getDescriptorForType ()
Overrides
getRetainUntilTime()
public 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
String
The retainUntilTime.
getRetainUntilTimeBytes()
public 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
ByteString
The bytes for retainUntilTime.
getRetentionMode()
public 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];
getRetentionModeValue()
public 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
int
The enum numeric value on the wire for retentionMode.
hasRetainUntilTime()
public 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
boolean
Whether the retainUntilTime field is set.
hasRetentionMode()
public 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
boolean
Whether the retentionMode field is set.
internalGetFieldAccessorTable()
protected GeneratedMessageV3 . FieldAccessorTable internalGetFieldAccessorTable ()
Overrides
isInitialized()
public final boolean isInitialized ()
Overrides
mergeFrom(ObjectRetention other)
public ObjectRetention . Builder mergeFrom ( ObjectRetention other )
public ObjectRetention . Builder mergeFrom ( CodedInputStream input , ExtensionRegistryLite extensionRegistry )
Overrides
mergeFrom(Message other)
public ObjectRetention . Builder mergeFrom ( Message other )
Parameter
Name
Description
other
Message
Overrides
mergeUnknownFields(UnknownFieldSet unknownFields)
public final ObjectRetention . Builder mergeUnknownFields ( UnknownFieldSet unknownFields )
Overrides
setField(Descriptors.FieldDescriptor field, Object value)
public ObjectRetention . Builder setField ( Descriptors . FieldDescriptor field , Object value )
Overrides
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public ObjectRetention . Builder setRepeatedField ( Descriptors . FieldDescriptor field , int index , Object value )
Overrides
setRetainUntilTime(String value)
public ObjectRetention . Builder setRetainUntilTime ( String value )
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];
Parameter
Name
Description
value
String The retainUntilTime to set.
setRetainUntilTimeBytes(ByteString value)
public ObjectRetention . Builder setRetainUntilTimeBytes ( ByteString value )
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];
Parameter
Name
Description
value
ByteString The bytes for retainUntilTime to set.
setRetentionMode(ObjectRetention.RetentionMode value)
public ObjectRetention . Builder setRetentionMode ( ObjectRetention . RetentionMode value )
Required. The retention mode of the object.
optional .google.cloud.storagebatchoperations.v1.ObjectRetention.RetentionMode retention_mode = 2 [(.google.api.field_behavior) = REQUIRED];
setRetentionModeValue(int value)
public ObjectRetention . Builder setRetentionModeValue ( int value )
Required. The retention mode of the object.
optional .google.cloud.storagebatchoperations.v1.ObjectRetention.RetentionMode retention_mode = 2 [(.google.api.field_behavior) = REQUIRED];
Parameter
Name
Description
value
int The enum numeric value on the wire for retentionMode to set.
setUnknownFields(UnknownFieldSet unknownFields)
public final ObjectRetention . Builder setUnknownFields ( UnknownFieldSet unknownFields )
Overrides
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-01-21 UTC.
Need to tell us more?
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-01-21 UTC."],[],[]]