TemporalOffset<Temporal>
TemporalUnitLessThanOffset
, TemporalUnitWithinOffset
public abstract class TemporalUnitOffset extends Object implements TemporalOffset<Temporal>
TemporalOffset
on basis of TemporalUnit
.Modifier and Type | Field | Description |
---|---|---|
protected long |
value |
Constructor | Description |
---|---|
TemporalUnitOffset(long value,
TemporalUnit unit) |
Creates a new temporal offset for a given temporal unit.
|
Modifier and Type | Method | Description |
---|---|---|
String |
getBeyondOffsetDifferenceDescription(Temporal temporal1,
Temporal temporal2) |
Returns description of the difference between temporal values and expected offset details.
|
protected long |
getDifference(Temporal temporal1,
Temporal temporal2) |
Returns absolute value of the difference according to time unit.
|
TemporalUnit |
getUnit() |
|
long |
getValue() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isBeyondOffset
public TemporalUnitOffset(long value, TemporalUnit unit)
value
- the value of the offset.unit
- temporal unit of the offset.NullPointerException
- if the given unit is null
.IllegalArgumentException
- if the given value is negative.public String getBeyondOffsetDifferenceDescription(Temporal temporal1, Temporal temporal2)
getBeyondOffsetDifferenceDescription
in interface TemporalOffset<Temporal>
temporal1
- first temporal value which is being validated against second temporal value.temporal2
- second temporal value.protected long getDifference(Temporal temporal1, Temporal temporal2)
public TemporalUnit getUnit()
public long getValue()
Copyright © 2014–2019. All rights reserved.