Package org.apache.catalina.filters
Record Class ExpiresFilter.Duration
java.lang.Object
java.lang.Record
org.apache.catalina.filters.ExpiresFilter.Duration
- Record Components:
amount
- Magnitude of durationunit
- Unit of duration
- Enclosing class:
- ExpiresFilter
public static record ExpiresFilter.Duration(int amount, ExpiresFilter.DurationUnit unit)
extends Record
Duration composed of an
amount
and a unit
-
Constructor Summary
ConstructorsConstructorDescriptionDuration
(int amount, ExpiresFilter.DurationUnit unit) Creates an instance of aDuration
record class. -
Method Summary
Modifier and TypeMethodDescriptionint
amount()
Returns the value of theamount
record component.final boolean
Indicates whether some other object is "equal to" this one.int
getUnit()
final int
hashCode()
Returns a hash code value for this object.toString()
Returns a string representation of this record class.unit()
Returns the value of theunit
record component.
-
Constructor Details
-
Method Details
-
getAmount
public int getAmount() -
getUnit
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
amount
public int amount()Returns the value of theamount
record component.- Returns:
- the value of the
amount
record component
-
unit
Returns the value of theunit
record component.- Returns:
- the value of the
unit
record component
-