Package me.ahoo.cosid.sharding
Class IntervalStep
java.lang.Object
me.ahoo.cosid.sharding.IntervalStep
Interval Step.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfloorUnit
(LocalDateTime time) 按照unit
保留单位时间精度.int
getUnit()
next
(LocalDateTime previous) static IntervalStep
of
(ChronoUnit unit) static IntervalStep
of
(ChronoUnit unit, int amount) int
offsetUnit
(LocalDateTime start, LocalDateTime time) 计算单位偏移量.
-
Field Details
-
DEFAULT_AMOUNT
public static final int DEFAULT_AMOUNT- See Also:
-
-
Constructor Details
-
IntervalStep
-
-
Method Details
-
getUnit
-
getAmount
public int getAmount() -
next
-
floorUnit
按照unit
保留单位时间精度.- Parameters:
time
- time- Returns:
- Unit precision LocalDateTime
-
offsetUnit
计算单位偏移量. Start with 0- Parameters:
start
- 最小值time
- time- Returns:
- offset
-
of
-
of
-