Package org.nuxeo.ecm.core.api.model
Class DeltaLong
- java.lang.Object
-
- java.lang.Number
-
- org.nuxeo.ecm.core.api.model.Delta
-
- org.nuxeo.ecm.core.api.model.DeltaLong
-
- All Implemented Interfaces:
Serializable
public class DeltaLong extends Delta
Value holding a baseLong
value and a delta.This is used when the actual intent of the value is to be an incremental update to an existing value.
- Since:
- 6.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DeltaLong(long base, long delta)
Deprecated.since 8.3, useDeltaLong(Long, long)
instead.DeltaLong(Long base, long delta)
ADeltaLong
with the given base and delta.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Number
add(Number other)
Adds this delta to a number.Delta
add(Delta other)
Adds this delta to another delta.static DeltaLong
deltaOrLong(Number base, long delta)
Deprecated.since 8.3, usevalueOf(Number, long)
instead.double
doubleValue()
boolean
equals(Object obj)
float
floatValue()
Long
getBase()
Gets the base value.long
getDelta()
Long
getDeltaValue()
Gets the delta value as an object.Long
getFullValue()
Gets the full value (base + delta) as an object.int
hashCode()
int
intValue()
long
longValue()
String
toString()
static DeltaLong
valueOf(Number base, long delta)
Returns aDeltaLong
from the given base number and delta.-
Methods inherited from class java.lang.Number
byteValue, shortValue
-
-
-
-
Constructor Detail
-
DeltaLong
@Deprecated public DeltaLong(long base, long delta)
Deprecated.since 8.3, useDeltaLong(Long, long)
instead.ADeltaLong
with the given base and delta.
-
-
Method Detail
-
valueOf
public static DeltaLong valueOf(Number base, long delta)
Returns aDeltaLong
from the given base number and delta.The base number may be a
Long
(which may be null), or aDeltaLong
. If it is aDeltaLong
then the returned value will keep its base and just add deltas.- Parameters:
base
- the base numberdelta
- the delta- Returns:
- a
DeltaLong
-
deltaOrLong
@Deprecated public static DeltaLong deltaOrLong(Number base, long delta)
Deprecated.since 8.3, usevalueOf(Number, long)
instead.Returns aDeltaLong
from the given base number and delta.The base number may be a
Long
(which may be null), or aDeltaLong
. If it is aDeltaLong
then the returned value will keep its base and just add deltas.- Parameters:
base
- the base numberdelta
- the delta- Returns:
- a
DeltaLong
-
add
public Delta add(Delta other)
Description copied from class:Delta
Adds this delta to another delta.
-
add
public Number add(Number other)
Description copied from class:Delta
Adds this delta to a number.
-
getDelta
public long getDelta()
-
getDeltaValue
public Long getDeltaValue()
Description copied from class:Delta
Gets the delta value as an object.- Specified by:
getDeltaValue
in classDelta
- Returns:
- the delta value
-
getFullValue
public Long getFullValue()
Description copied from class:Delta
Gets the full value (base + delta) as an object.- Specified by:
getFullValue
in classDelta
- Returns:
- the full value
-
floatValue
public float floatValue()
- Specified by:
floatValue
in classNumber
-
doubleValue
public double doubleValue()
- Specified by:
doubleValue
in classNumber
-
-