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
ConstructorsConstructorDescriptionNumberContainer(String boxValue) Create an instance of aNumberContainerwith a raw value. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract BigDecimalgetBigDecimalValue(T val) Get theBigDecimalrepresentation of a value of the container's boxed typegetFinalValue(@NotNull String input) Get the final value from a user input for committingprotected abstract BigDecimalgetMax()Get the maximum allowable value that can be represented by this numerical typeprotected abstract BigDecimalgetMin()Get the minimum allowable value that can be represented by this numerical typebooleanabstract StringtoString()Methods inherited from class com.cryptoalgo.oursql.model.db.data.Container
getInstance, getTypes, getValue, isEditable, toSQLString, unbox
-
Constructor Details
-
NumberContainer
Create an instance of aNumberContainerwith 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 theBigDecimalrepresentation of a value of the container's boxed type- Parameters:
val- A value- Returns:
- The
BigDecimalrepresentation of the value
-
getFinalValue
Description copied from class:ContainerGet the final value from a user input for committing- Overrides:
getFinalValuein classContainer<T extends Number>- Parameters:
input- Raw input- Returns:
- Output to be used for the commit operation
-
isValid
-
toString
-