java.lang.Object
com.aoindustries.aoserv.client.AoservObject<Integer,Type>
com.aoindustries.aoserv.client.GlobalObject<Integer,Type>
com.aoindustries.aoserv.client.GlobalObjectIntegerKey<Type>
com.aoindustries.aoserv.client.schema.Type
- All Implemented Interfaces:
Streamable
,StreamReadable
,StreamWritable
,Row
,AoservReadable
,AoservStreamable
,AoservWritable
- Author:
- AO Industries, Inc.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
TODO: UnmodifiableDate.static final String
static final TimeZone
The time zone used for all
to/from String conversions.DATE
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final long
The number of milliseconds in a day.static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
Fields inherited from class com.aoindustries.aoserv.client.GlobalObjectIntegerKey
pkey
Fields inherited from class com.aoindustries.aoserv.client.AoservObject
USE_ARRAY_OF_DOMAIN, USE_SQL_DATA, USE_SQL_DATA_WRITE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
static boolean
alignRight
(int id) cast
(AoservConnector conn, Object value, Type castToType) Casts one type of object to another.int
static int
Compares two values lexicographically.protected Object
getColumnImpl
(int i) static long
getDaysFromMillis
(long time) Gets the number of days from epoch in GMT.int
getId()
getLastVersion
(AoservConnector connector) int
Gets the maximum precision for this type or-1
when unbounded.static int
getMaxPrecision
(int type) Gets the maximum precision for the given type or-1
when unbounded.static long
getMillisFromDays
(long days) Gets the number of milliseconds from epoch in GMT.getName()
int
getPrecision
(Object value) static int
getPrecision
(Object value, int type) getSinceVersion
(AoservConnector connector) static String
void
Initializes this object from the raw database contents.static Object
parseString
(String s, int id) void
read
(StreamableInput in, AoservProtocol.Version protocolVersion) static long
roundToDate
(long time) Rounds the time to an exact day in GMT.boolean
Checks if this type supports any precisions other than default-1
.static boolean
supportsPrecision
(int type) Checks if the given type supports any precisions other than default-1
.AoservObject.toString()
implementation that is allowed to throw exceptions.void
write
(StreamableOutput out, AoservProtocol.Version protocolVersion) Methods inherited from class com.aoindustries.aoserv.client.GlobalObjectIntegerKey
equals, getKey, getPkey, hashCode
Methods inherited from class com.aoindustries.aoserv.client.AoservObject
compare, compare, compare, compare, compareIgnoreCaseConsistentWithEquals, compareTo, compareTo, compareTo, getAccountingCode, getColumn, getColumns, getColumns, getDomainLabel, getDomainLabels, getDomainName, getDto, getEmail, getGecos, getGroupId, getHashedKey, getHashedPassword, getHostname, getInetAddress, getLinuxId, getLinuxUserName, getMacAddress, getMysqlDatabaseName, getMysqlServerName, getMysqlUserName, getPort, getPostgresDatabaseName, getPostgresServerName, getPostgresUserId, getTableSchema, getTimeMillis, getTimeMillis, getUnixPath, getUserId, read, toString, write
-
Field Details
-
DATE_TIME_ZONE
The time zone used for all
to/from String conversions. Is "GMT" and is not expected to change, but all date-based parsing, formatting, conversions, comparisons, or filters should use this constant as the time zone.DATE
-
DATE_name
- See Also:
-
ACCOUNTING
public static final int ACCOUNTING- See Also:
-
BOOLEAN
public static final int BOOLEAN- See Also:
-
DATE
public static final int DATETODO: UnmodifiableDate.- See Also:
-
DECIMAL_2
public static final int DECIMAL_2- See Also:
-
DECIMAL_3
public static final int DECIMAL_3- See Also:
-
DOUBLE
public static final int DOUBLE- See Also:
-
EMAIL
public static final int EMAIL- See Also:
-
FKEY
public static final int FKEY- See Also:
-
FLOAT
public static final int FLOAT- See Also:
-
HOSTNAME
public static final int HOSTNAME- See Also:
-
INT
public static final int INT- See Also:
-
INTERVAL
public static final int INTERVAL- See Also:
-
IP_ADDRESS
public static final int IP_ADDRESS- See Also:
-
LONG
public static final int LONG- See Also:
-
OCTAL_LONG
public static final int OCTAL_LONG- See Also:
-
PKEY
public static final int PKEY- See Also:
-
PATH
public static final int PATH- See Also:
-
PHONE
public static final int PHONE- See Also:
-
SHORT
public static final int SHORT- See Also:
-
STRING
public static final int STRING- See Also:
-
TIME
public static final int TIME- See Also:
-
URL
public static final int URL- See Also:
-
USERNAME
public static final int USERNAME- See Also:
-
ZONE
public static final int ZONE- See Also:
-
BIG_DECIMAL
public static final int BIG_DECIMAL- See Also:
-
DOMAIN_LABEL
public static final int DOMAIN_LABEL- See Also:
-
DOMAIN_LABELS
public static final int DOMAIN_LABELS- See Also:
-
DOMAIN_NAME
public static final int DOMAIN_NAME- See Also:
-
GECOS
public static final int GECOS- See Also:
-
GROUP_ID
public static final int GROUP_ID- See Also:
-
HASHED_PASSWORD
public static final int HASHED_PASSWORD- See Also:
-
LINUX_ID
public static final int LINUX_ID- See Also:
-
MAC_ADDRESS
public static final int MAC_ADDRESS- See Also:
-
MONEY
public static final int MONEY- See Also:
-
MYSQL_DATABASE_NAME
public static final int MYSQL_DATABASE_NAME- See Also:
-
MYSQL_SERVER_NAME
public static final int MYSQL_SERVER_NAME- See Also:
-
MYSQL_TABLE_NAME
public static final int MYSQL_TABLE_NAME- See Also:
-
MYSQL_USERNAME
public static final int MYSQL_USERNAME- See Also:
-
NET_PORT
public static final int NET_PORT- See Also:
-
POSTGRES_DATABASE_NAME
public static final int POSTGRES_DATABASE_NAME- See Also:
-
POSTGRES_SERVER_NAME
public static final int POSTGRES_SERVER_NAME- See Also:
-
POSTGRES_USERNAME
public static final int POSTGRES_USERNAME- See Also:
-
FIREWALLD_ZONE_NAME
public static final int FIREWALLD_ZONE_NAME- See Also:
-
LINUX_USERNAME
public static final int LINUX_USERNAME- See Also:
-
IDENTIFIER
public static final int IDENTIFIER- See Also:
-
SMALL_IDENTIFIER
public static final int SMALL_IDENTIFIER- See Also:
-
HASHED_KEY
public static final int HASHED_KEY- See Also:
-
MILLIS_PER_DAY
public static final long MILLIS_PER_DAYThe number of milliseconds in a day.- See Also:
-
-
Constructor Details
-
Type
Deprecated.Only required for implementation, do not use directly.- See Also:
-
-
Method Details
-
alignRight
public boolean alignRight() -
alignRight
public static boolean alignRight(int id) -
cast
public Object cast(AoservConnector conn, Object value, Type castToType) throws IOException, SQLException Casts one type of object to another. These casts are allowed:P O S P M T O F Y G S I S M R T P R Q Y M E G O E S H L S Y S R S W M A _ Q S M _ E T A L A D S D L Q Y D S G L I L D O H A _ L S A _ R L N L B O M D E M T S _ Q T S E D U _ A I O I M A O D A A E T L A E S _ X I I H C D D P C G A I M _ C B R A _ B R _ Z _ D D A C E E H I _ T U _ I N A G P L _ A V B U N A V U O U E E S T O B C C O N A A S D N _ I R A I A S E L S E S E S N S N N H O U O I I D S T D L S E E _ L N O S N D E R E E T E R E E E T T E N O M M O E F T E D _ P S T R C L A _ G U S U D M _ _ _ R _ _ _ R _ R I I D T L D A A U M F L N R R L L P P H H R T N Z I A B N E P W X R O N N N N P N N N N N F F _ I E A L L B A K O A I V E O O K A O O I I U A O M B E A C _ O _ E N A A A A O A A A A A I I K N A T _ _ L I E A M N A S N N E T N R N M R M N A E L M O I R I S E M M M M R M M M M M E E E FROM G N E 2 3 E L Y T E T L S G G Y H E T G E L E E L L S E S D D D S Y E E E E T E E E E E R R Y ACCOUNTING X X BOOLEAN X X X X X X X X X X X DATE X X X X X X X X X X X X DECIMAL_2 X X X X X X X X X X X X X DECIMAL_3 X X X X X X X X X X X X X DOUBLE X X X X X X X X X X X X X EMAIL X X X X X X X X FKEY X X X X FLOAT X X X X X X X X X X X X X HOSTNAME X X X X X INT X X X X X X X X X X X X X X X X X INTERVAL X X X X X X X X X X X IP_ADDRESS X X LONG X X X X X X X X X X X X X X X OCTAL_LONG X X X X X X X X X X X X X X X PKEY X X X X PATH X X PHONE X X X SHORT X X X X X X X X X X X X X STRING X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X TIME X X X X X URL X X X X X X USERNAME X X X X X ZONE X X X X BIG_DECIMAL X X X X X X X X X X X X X X DOMAIN_LABEL X X X X DOMAIN_LABELS X X X DOMAIN_NAME X X X X X GECOS X X GROUP_ID X X HASHED_PASSWORD X X LINUX_ID X X X X MAC_ADDRESS X X MONEY X X X MYSQL_DATABASE_NAME X X MYSQL_SERVER_NAME X X MYSQL_TABLE_NAME X X MYSQL_USERNAME X X X X NET_PORT X X X POSTGRES_DATABASE_NAME X X POSTGRES_SERVER_NAME X X POSTGRES_USERNAME X X X X FIREWALLD_ZONE_NAME X X LINUX_USERNAME X X X X X IDENTIFIER X X X SMALL_IDENTIFIER X X X X X HASHED_KEY X X
- Throws:
IOException
SQLException
-
getDaysFromMillis
public static long getDaysFromMillis(long time) Gets the number of days from epoch in GMT. -
getMillisFromDays
public static long getMillisFromDays(long days) Gets the number of milliseconds from epoch in GMT. -
roundToDate
public static long roundToDate(long time) Rounds the time to an exact day in GMT. -
compareTo
public int compareTo(Object value1, Object value2) throws IllegalArgumentException, SQLException, UnknownHostException -
compareTo
Compares two values lexicographically. The values must be of the same type.- Parameters:
value1
- the first value being comparedvalue2
- the second value being comparedid
- the data type- Returns:
- the value
0
if the two values are equal; a value less than0
if the first value is lexicographically less than the second value; and a value greater than0
if the first value is lexicographically greater than the second value. - Throws:
IllegalArgumentException
- if the type is invalid
-
getColumnImpl
- Specified by:
getColumnImpl
in classAoservObject<Integer,
Type>
-
getId
public int getId() -
getName
-
getSinceVersion_version
-
getSinceVersion
- Throws:
SQLException
IOException
-
getLastVersion_version
-
getLastVersion
- Throws:
SQLException
IOException
-
getTableId
- Specified by:
getTableId
in classAoservObject<Integer,
Type>
-
init
Description copied from class:AoservObject
Initializes this object from the raw database contents.- Specified by:
init
in classAoservObject<Integer,
Type> - Parameters:
result
- theResultSet
containing the row to copy into this object- Throws:
SQLException
-
read
- Specified by:
read
in interfaceAoservReadable
- Specified by:
read
in interfaceAoservStreamable
- Specified by:
read
in classAoservObject<Integer,
Type> - Throws:
IOException
-
write
- Specified by:
write
in interfaceAoservStreamable
- Specified by:
write
in interfaceAoservWritable
- Specified by:
write
in classAoservObject<Integer,
Type> - Throws:
IOException
-
toStringImpl
Description copied from class:AoservObject
AoservObject.toString()
implementation that is allowed to throw exceptions.Implementation Note:
This default implementation callsAoservObject.toString()
on the key (fromAoservObject.getKey()
). When the key isnull
, uses the default implementation fromObject.toString()
.- Overrides:
toStringImpl
in classGlobalObjectIntegerKey<Type>
-
supportsPrecision
public boolean supportsPrecision()Checks if this type supports any precisions other than default-1
. This can be used to short-cut somethings when it is known no precisions will be returned. -
supportsPrecision
public static boolean supportsPrecision(int type) Checks if the given type supports any precisions other than default-1
. This can be used to short-cut somethings when it is known no precisions will be returned. -
getMaxPrecision
public int getMaxPrecision()Gets the maximum precision for this type or-1
when unbounded. This can be used to stop searching for largest precision once the maximum possible value has been found. -
getMaxPrecision
public static int getMaxPrecision(int type) Gets the maximum precision for the given type or-1
when unbounded. This can be used to stop searching for largest precision once the maximum possible value has been found. -
getPrecision
-
getPrecision
-
getString
-
getString
public static String getString(Object value, int precision, int type) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
parseString
- Throws:
IllegalArgumentException
-
parseString
- Throws:
IllegalArgumentException
-