public final class RetentionPolicy extends Object
Instance of this class are immutable.
| Modifier and Type | Class and Description |
|---|---|
static class |
RetentionPolicy.Builder
Used to create instances of
RetentionPolicy. |
| Modifier and Type | Method and Description |
|---|---|
RetentionPolicy |
asDefault(boolean isDefault)
Creates a copy of this instance with a new value for
isDefault. |
boolean |
equals(Object o) |
Duration |
getDuration()
Gets the
duration of this retention policy. |
String |
getName()
Gets the name of this retention policy.
|
int |
getReplication()
Gets the
replication factor of this retention policy. |
Duration |
getShardDuration()
Gets the
shard duration of this retention policy. |
int |
hashCode() |
boolean |
isDefault()
Gets a value indicating whether this retention policy is the default.
|
String |
toString() |
RetentionPolicy |
withDuration(Duration duration)
Creates a copy of this instance with the specified
duration. |
RetentionPolicy |
withReplication(int replication)
Creates a copy of this instance with the specified
replication factor. |
RetentionPolicy |
withShardDuration(Duration shardDuration)
Creates a copy of this instance with a new
shard duration. |
public String getName()
public Duration getDuration()
duration of this retention policy.public RetentionPolicy withDuration(Duration duration)
duration.duration - the new duration valuepublic int getReplication()
replication factor of this retention policy.public RetentionPolicy withReplication(int replication)
replication factor.replication - the new replication valuepublic Duration getShardDuration()
shard duration of this retention policy.public RetentionPolicy withShardDuration(Duration shardDuration)
shard duration.shardDuration - the new shard duration valuepublic boolean isDefault()
true if this is the default, false otherwisepublic RetentionPolicy asDefault(boolean isDefault)
isDefault.isDefault - true if this retention policy is the default, false
otherwiseCopyright © 2020. All rights reserved.