Record Class RetentionPolicy
java.lang.Object
java.lang.Record
org.j7m.middleware.api.durablelog.RetentionPolicy
- Record Components:
mode- retention modemaxBytes- maximum retained bytes for size retentionmaxAge- maximum retained age for age retention
- All Implemented Interfaces:
Serializable
public record RetentionPolicy(RetentionPolicy.RetentionMode mode, long maxBytes, Duration maxAge)
extends Record
implements Serializable
Durable-log retention policy.
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionRetentionPolicy(RetentionPolicy.RetentionMode mode, long maxBytes, Duration maxAge) Creates a retention policy. -
Method Summary
Modifier and TypeMethodDescriptionstatic RetentionPolicydisabled()Disabled retention.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.maxAge()Returns the value of themaxAgerecord component.static RetentionPolicyAge-based retention.longmaxBytes()Returns the value of themaxBytesrecord component.static RetentionPolicymaxBytes(long bytes) Size-based retention.mode()Returns the value of themoderecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
RetentionPolicy
Creates a retention policy.
-
-
Method Details
-
disabled
-
maxBytes
Size-based retention.- Parameters:
bytes- maximum retained bytes- Returns:
- size-based retention policy
-
maxAge
Age-based retention.- Parameters:
age- maximum retained age- Returns:
- age-based retention policy
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
mode
-
maxBytes
-
maxAge
-