Module com.cryptoalgo.oursql.oursql
Class NumberContainer<T extends Number>
java.lang.Object
com.cryptoalgo.oursql.model.db.data.Container<T>
com.cryptoalgo.oursql.model.db.data.NumberContainer<T>
- Type Parameters:
T
- Numerical type for the container.
- Direct Known Subclasses:
FloatNumberContainer
,IntNumberContainer
An abstract container to store various numerical SQL types
-
Field Summary
-
Constructor Summary
ConstructorDescriptionNumberContainer
(String boxValue) Create an instance of aNumberContainer
with a raw value. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract BigDecimal
getBigDecimalValue
(T val) Get theBigDecimal
representation of a value of the container's boxed typegetFinalValue
(@NotNull String input) Get the final value from a user input for committingprotected abstract BigDecimal
getMax()
Get the maximum allowable value that can be represented by this numerical typeprotected abstract BigDecimal
getMin()
Get the minimum allowable value that can be represented by this numerical typeboolean
abstract String
toString()
Methods inherited from class com.cryptoalgo.oursql.model.db.data.Container
getInstance, getTypes, getValue, isEditable, toSQLString, unbox
-
Constructor Details
-
NumberContainer
Create an instance of aNumberContainer
with a raw value.- Parameters:
boxValue
- Raw value to unbox into container
-
-
Method Details
-
getMin
Get the minimum allowable value that can be represented by this numerical type- Returns:
- Minimum value that can be represented by this numerical type
-
getMax
Get the maximum allowable value that can be represented by this numerical type- Returns:
- Maximum value that can be represented by this numerical type
-
getBigDecimalValue
Get theBigDecimal
representation of a value of the container's boxed type- Parameters:
val
- A value- Returns:
- The
BigDecimal
representation of the value
-
getFinalValue
Description copied from class:Container
Get the final value from a user input for committing- Overrides:
getFinalValue
in classContainer<T extends Number>
- Parameters:
input
- Raw input- Returns:
- Output to be used for the commit operation
-
isValid
-
toString
-