Module com.cryptoalgo.oursql.oursql
Class IntNumberContainer
java.lang.Object
com.cryptoalgo.oursql.model.db.data.Container<T>
com.cryptoalgo.oursql.model.db.data.NumberContainer<Integer>
com.cryptoalgo.oursql.model.db.data.IntNumberContainer
A container for int-based SQL types
-
Field Summary
-
Constructor Summary
ConstructorDescriptionIntNumberContainer
(String boxValue) Create an instance of this container with a string to decode and unbox. -
Method Summary
Modifier and TypeMethodDescriptionprotected BigDecimal
Get theBigDecimal
representation of a value of the container's boxed typeprotected BigDecimal
getMax()
Get the maximum allowable value that can be represented by this numerical typeprotected BigDecimal
getMin()
Get the minimum allowable value that can be represented by this numerical typeboolean
toString()
"Unbox" a raw string to the boxed typeMethods inherited from class com.cryptoalgo.oursql.model.db.data.NumberContainer
getFinalValue
Methods inherited from class com.cryptoalgo.oursql.model.db.data.Container
getInstance, getTypes, getValue, isEditable, toSQLString
-
Constructor Details
-
IntNumberContainer
Create an instance of this container with a string to decode and unbox. Construction will fail if the provided raw string cannot be parsed as an int.- Parameters:
boxValue
- Raw string to decode and unbox into this container
-
-
Method Details
-
unbox
Description copied from class:Container
"Unbox" a raw string to the boxed type -
getMin
Description copied from class:NumberContainer
Get the minimum allowable value that can be represented by this numerical type- Specified by:
getMin
in classNumberContainer<Integer>
- Returns:
- Minimum value that can be represented by this numerical type
-
getMax
Description copied from class:NumberContainer
Get the maximum allowable value that can be represented by this numerical type- Specified by:
getMax
in classNumberContainer<Integer>
- Returns:
- Maximum value that can be represented by this numerical type
-
getBigDecimalValue
Description copied from class:NumberContainer
Get theBigDecimal
representation of a value of the container's boxed type- Specified by:
getBigDecimalValue
in classNumberContainer<Integer>
- Parameters:
val
- A value- Returns:
- The
BigDecimal
representation of the value
-
isValid
- Overrides:
isValid
in classNumberContainer<Integer>
- Parameters:
value
- Value to be checked- Returns:
- true if
value
can be cast to the type of this container
-
toString
- Specified by:
toString
in classNumberContainer<Integer>
-