public class MySqlUnsignedIntegerConverter extends Object
Modifier and Type | Field and Description |
---|---|
private static BigDecimal |
BIGINT_CORRECTION |
private static BigDecimal |
BIGINT_MAX_VALUE |
private static long |
INT_CORRECTION |
private static long |
INT_MAX_VALUE |
private static int |
MEDIUMINT_CORRECTION |
private static int |
MEDIUMINT_MAX_VALUE |
private static int |
SMALLINT_CORRECTION |
private static int |
SMALLINT_MAX_VALUE |
private static short |
TINYINT_CORRECTION |
private static short |
TINYINT_MAX_VALUE
Maximum values for Unsigned Integer Types.
|
Modifier | Constructor and Description |
---|---|
private |
MySqlUnsignedIntegerConverter()
Private constructor
|
Modifier and Type | Method and Description |
---|---|
static BigDecimal |
convertUnsignedBigint(BigDecimal originalNumber)
Convert original value insertion of type 'BIGINT' into the correct BIGINT UNSIGNED representation
Note: Unsigned BIGINT (16-bit) is represented in 'BigDecimal' data type.
|
static long |
convertUnsignedInteger(long originalNumber)
Convert original value insertion of type 'INT' into the correct INT UNSIGNED representation
Note: Unsigned INT (32-bit) is represented in 'Long' 64-bit data type.
|
static int |
convertUnsignedMediumint(int originalNumber)
Convert original value insertion of type 'MEDIUMINT' into the correct MEDIUMINT UNSIGNED representation
Note: Unsigned MEDIUMINT (32-bit) is represented in 'Integer' 32-bit data type since the MAX value of Unsigned MEDIUMINT 16777215 < Max value of Integer 2147483647
|
static int |
convertUnsignedSmallint(int originalNumber)
Convert original value insertion of type 'SMALLINT' into the correct SMALLINT UNSIGNED representation
Note: Unsigned SMALLINT (16-bit) is represented in 'Integer' 32-bit data type.
|
static short |
convertUnsignedTinyint(short originalNumber)
Convert original value insertion of type 'TINYINT' into the correct TINYINT UNSIGNED representation
Note: Unsigned TINYINT (8-bit) is represented in 'Short' 16-bit data type.
|
private static final short TINYINT_MAX_VALUE
https://dev.mysql.com/doc/refman/5.7/en/integer-types.html
private static final int SMALLINT_MAX_VALUE
private static final int MEDIUMINT_MAX_VALUE
private static final long INT_MAX_VALUE
private static final BigDecimal BIGINT_MAX_VALUE
private static final short TINYINT_CORRECTION
private static final int SMALLINT_CORRECTION
private static final int MEDIUMINT_CORRECTION
private static final long INT_CORRECTION
private static final BigDecimal BIGINT_CORRECTION
private MySqlUnsignedIntegerConverter()
public static short convertUnsignedTinyint(short originalNumber)
public static int convertUnsignedSmallint(int originalNumber)
public static int convertUnsignedMediumint(int originalNumber)
public static long convertUnsignedInteger(long originalNumber)
public static BigDecimal convertUnsignedBigint(BigDecimal originalNumber)
originalNumber
- BigDecimal
the original insertion valueBigDecimal
the correct representation of the original insertion valueCopyright © 2020 JBoss by Red Hat. All rights reserved.