Package org.greenbytes.http.sfv
Interface NumberItem<T>
-
- Type Parameters:
T- represented Java type
- All Superinterfaces:
Item<T>,ListElement<T>,LongSupplier,Parameterizable<T>,Supplier<T>,Type<T>
- All Known Implementing Classes:
DateItem,DecimalItem,IntegerItem
public interface NumberItem<T> extends Item<T>, LongSupplier
Common interface for allTypes that can carry numbers.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetDivisor()Returns the divisor to be used to obtain the actual numerical value (as opposed to the underlying long value returned byLongSupplier.getAsLong()).NumberItem<T>withParams(Parameters params)Given an existingItem, return a new instance with the specifiedParameters.-
Methods inherited from interface java.util.function.LongSupplier
getAsLong
-
Methods inherited from interface org.greenbytes.http.sfv.Parameterizable
getParams
-
Methods inherited from interface org.greenbytes.http.sfv.Type
serialize, serializeTo
-
-
-
-
Method Detail
-
getDivisor
int getDivisor()
Returns the divisor to be used to obtain the actual numerical value (as opposed to the underlying long value returned byLongSupplier.getAsLong()).- Returns:
- the divisor (
1for Integers,1000for Decimals)
-
withParams
NumberItem<T> withParams(Parameters params)
Description copied from interface:ParameterizableGiven an existingItem, return a new instance with the specifiedParameters.- Specified by:
withParamsin interfaceItem<T>- Specified by:
withParamsin interfaceParameterizable<T>- Parameters:
params-Parametersto set (must be non-null)- Returns:
- new instance with specified
Parameters.
-
-