Package org.apache.cassandra.config
Class DurationSpec
- java.lang.Object
-
- org.apache.cassandra.config.DurationSpec
-
- Direct Known Subclasses:
DurationSpec.IntMillisecondsBound,DurationSpec.IntMinutesBound,DurationSpec.IntSecondsBound,DurationSpec.LongMillisecondsBound,DurationSpec.LongNanosecondsBound,DurationSpec.LongSecondsBound
public abstract class DurationSpec extends java.lang.ObjectRepresents a positive time duration. Wrapper class for Cassandra duration configuration parameters, providing to the users the opportunity to be able to provide config with a unit of their choice in cassandra.yaml as per the available options. (CASSANDRA-15234)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDurationSpec.IntMillisecondsBoundRepresents a duration used for Cassandra configuration.static classDurationSpec.IntMinutesBoundRepresents a duration used for Cassandra configuration.static classDurationSpec.IntSecondsBoundRepresents a duration used for Cassandra configuration.static classDurationSpec.LongMillisecondsBoundRepresents a duration used for Cassandra configuration.static classDurationSpec.LongNanosecondsBoundRepresents a duration used for Cassandra configuration.static classDurationSpec.LongSecondsBoundRepresents a duration used for Cassandra configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)inthashCode()longquantity()longto(java.util.concurrent.TimeUnit targetUnit)java.lang.StringtoString()java.util.concurrent.TimeUnitunit()
-
-
-
Method Detail
-
quantity
public long quantity()
-
unit
public java.util.concurrent.TimeUnit unit()
-
to
public long to(java.util.concurrent.TimeUnit targetUnit)
- Parameters:
targetUnit- the time unit- Returns:
- this duration in the specified time unit
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-