Package com.google.cloud.storage
Class BucketInfo.LifecycleRule.LifecycleCondition.Builder
java.lang.Object
com.google.cloud.storage.BucketInfo.LifecycleRule.LifecycleCondition.Builder
- Enclosing class:
- BucketInfo.LifecycleRule.LifecycleCondition
Builder for
LifecycleCondition
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds aLifecycleCondition
object.Sets the age in days.setCreatedBefore
(com.google.api.client.util.DateTime createdBefore) Deprecated.setCreatedBeforeOffsetDateTime
(OffsetDateTime createdBefore) Sets the date a Blob should be created before for an Action to be executed.setCustomTimeBefore
(com.google.api.client.util.DateTime customTimeBefore) Deprecated.setCustomTimeBeforeOffsetDateTime
(OffsetDateTime customTimeBefore) Sets the date with only the date part (for instance, "2013-01-15").setDaysSinceCustomTime
(Integer daysSinceCustomTime) Sets the number of days elapsed since the user-specified timestamp set on an object.setDaysSinceNoncurrentTime
(Integer daysSinceNoncurrentTime) Sets the number of days elapsed since the noncurrent timestamp of an object.Sets an isLive Boolean condition.setMatchesPrefix
(List<String> matchesPrefix) Sets the list of prefixes.setMatchesStorageClass
(List<StorageClass> matchesStorageClass) Sets a list of Storage Classes for a objects that satisfy the condition to execute the Action.setMatchesSuffix
(List<String> matchesSuffix) Sets the list of suffixes.setNoncurrentTimeBefore
(com.google.api.client.util.DateTime noncurrentTimeBefore) Deprecated.setNoncurrentTimeBeforeOffsetDateTime
(OffsetDateTime noncurrentTimeBefore) Sets the date with only the date part (for instance, "2013-01-15").setNumberOfNewerVersions
(Integer numberOfNewerVersions) Sets the number of newer versions a Blob should have for an Action to be executed.
-
Method Details
-
setAge
Sets the age in days. This condition is satisfied when a Blob reaches the specified age (in days). When you specify the Age condition, you are specifying a Time to Live (TTL) for objects in a bucket with lifecycle management configured. The time when the Age condition is considered to be satisfied is calculated by adding the specified value to the object creation time. -
setCreatedBefore
@Deprecated public BucketInfo.LifecycleRule.LifecycleCondition.Builder setCreatedBefore(com.google.api.client.util.DateTime createdBefore) Deprecated.Sets the date a Blob should be created before for an Action to be executed. Note that only the date will be considered, if the time is specified it will be truncated. This condition is satisfied when an object is created before midnight of the specified date in UTC. -
setCreatedBeforeOffsetDateTime
public BucketInfo.LifecycleRule.LifecycleCondition.Builder setCreatedBeforeOffsetDateTime(OffsetDateTime createdBefore) Sets the date a Blob should be created before for an Action to be executed. Note that only the date will be considered, if the time is specified it will be truncated. This condition is satisfied when an object is created before midnight of the specified date in UTC. -
setNumberOfNewerVersions
public BucketInfo.LifecycleRule.LifecycleCondition.Builder setNumberOfNewerVersions(Integer numberOfNewerVersions) Sets the number of newer versions a Blob should have for an Action to be executed. Relevant only when versioning is enabled on a bucket. * -
setIsLive
Sets an isLive Boolean condition. If the value is true, this lifecycle condition matches only live Blobs; if the value is false, it matches only archived objects. For the purposes of this condition, Blobs in non-versioned buckets are considered live. -
setMatchesStorageClass
public BucketInfo.LifecycleRule.LifecycleCondition.Builder setMatchesStorageClass(List<StorageClass> matchesStorageClass) Sets a list of Storage Classes for a objects that satisfy the condition to execute the Action. * -
setDaysSinceNoncurrentTime
public BucketInfo.LifecycleRule.LifecycleCondition.Builder setDaysSinceNoncurrentTime(Integer daysSinceNoncurrentTime) Sets the number of days elapsed since the noncurrent timestamp of an object. The condition is satisfied if the days elapsed is at least this number. This condition is relevant only for versioned objects. The value of the field must be a nonnegative integer. If it's zero, the object version will become eligible for Lifecycle action as soon as it becomes noncurrent. -
setNoncurrentTimeBefore
@Deprecated public BucketInfo.LifecycleRule.LifecycleCondition.Builder setNoncurrentTimeBefore(com.google.api.client.util.DateTime noncurrentTimeBefore) Deprecated.Sets the date in RFC 3339 format with only the date part (for instance, "2013-01-15"). Note that only date part will be considered, if the time is specified it will be truncated. This condition is satisfied when the noncurrent time on an object is before this date. This condition is relevant only for versioned objects. -
setNoncurrentTimeBeforeOffsetDateTime
public BucketInfo.LifecycleRule.LifecycleCondition.Builder setNoncurrentTimeBeforeOffsetDateTime(OffsetDateTime noncurrentTimeBefore) Sets the date with only the date part (for instance, "2013-01-15"). Note that only date part will be considered, if the time is specified it will be truncated. This condition is satisfied when the noncurrent time on an object is before this date. This condition is relevant only for versioned objects. -
setCustomTimeBefore
@Deprecated public BucketInfo.LifecycleRule.LifecycleCondition.Builder setCustomTimeBefore(com.google.api.client.util.DateTime customTimeBefore) Deprecated.Sets the date in RFC 3339 format with only the date part (for instance, "2013-01-15"). Note that only date part will be considered, if the time is specified it will be truncated. This condition is satisfied when the custom time on an object is before this date in UTC. -
setCustomTimeBeforeOffsetDateTime
public BucketInfo.LifecycleRule.LifecycleCondition.Builder setCustomTimeBeforeOffsetDateTime(OffsetDateTime customTimeBefore) Sets the date with only the date part (for instance, "2013-01-15"). Note that only date part will be considered, if the time is specified it will be truncated. This condition is satisfied when the custom time on an object is before this date in UTC. -
setDaysSinceCustomTime
public BucketInfo.LifecycleRule.LifecycleCondition.Builder setDaysSinceCustomTime(Integer daysSinceCustomTime) Sets the number of days elapsed since the user-specified timestamp set on an object. The condition is satisfied if the days elapsed is at least this number. If no custom timestamp is specified on an object, the condition does not apply. -
setMatchesPrefix
public BucketInfo.LifecycleRule.LifecycleCondition.Builder setMatchesPrefix(List<String> matchesPrefix) Sets the list of prefixes. If any prefix matches the beginning of the object’s name, this portion of the condition is satisfied for that object. -
setMatchesSuffix
public BucketInfo.LifecycleRule.LifecycleCondition.Builder setMatchesSuffix(List<String> matchesSuffix) Sets the list of suffixes. If any suffix matches the end of the object’s name, this portion of the condition is satisfied for that object. -
build
Builds aLifecycleCondition
object. *
-
setCreatedBeforeOffsetDateTime(OffsetDateTime)