Record Class RetentionPolicy.Composite
java.lang.Object
java.lang.Record
com.loomcache.server.journal.RetentionPolicy.Composite
- Record Components:
policies- List of policies (all must agree to retain)
- All Implemented Interfaces:
RetentionPolicy
- Enclosing interface:
RetentionPolicy
public static record RetentionPolicy.Composite(List<RetentionPolicy> policies)
extends Record
implements RetentionPolicy
Composite retention policy.
Applies multiple policies; an entry is retained only if ALL policies agree.
- Since:
- 1.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface RetentionPolicy
RetentionPolicy.Composite, RetentionPolicy.SizeBased, RetentionPolicy.TimeBased -
Constructor Summary
ConstructorsConstructorDescriptionComposite(List<RetentionPolicy> policies) Creates an instance of aCompositerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.policies()Returns the value of thepoliciesrecord component.booleanshouldRetain(JournalEntry entry, long currentTimeNanos) Check if an entry should be retained.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Composite
Creates an instance of aCompositerecord class.- Parameters:
policies- the value for thepoliciesrecord component
-
-
Method Details
-
shouldRetain
Description copied from interface:RetentionPolicyCheck if an entry should be retained.- Specified by:
shouldRetainin interfaceRetentionPolicy- Parameters:
entry- The entry to checkcurrentTimeNanos- Current time in nanoseconds- Returns:
- true if the entry should be kept, false if it can be removed
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
policies
-