public class Poid
extends java.lang.Object
implements java.io.Serializable
Poid class encapsulates the Portal POID data type. Each storable object
has a unique POID in Portal. The POID's fields identify the object's database, ID,
storable class type, and revision level. You use the POID to locate a storable object
in the database. Only the database subfield (db) must be valid at all times.
For more information about the POID data type, see Understanding the Portal Data Types in the Portal online documentation.
| Constructor and Description |
|---|
Poid(long db)
Constructs a partial
Poid from a database ID. |
Poid(long db,
long id)
Constructs a partial
Poid from a database ID
and an object ID. |
Poid(long db,
long id,
java.lang.String type)
Constructs a complete
Poid from a database ID,
object ID, and type string. |
Poid(long db,
long id,
java.lang.String type,
int rev)
Constructs a complete
Poid from a database ID,
object ID, type string, and revision level. |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Poid other)
Determines the sort order of two
Poids by comparing their fields. |
int |
compareToWithLp(Poid other)
Determines the sort order of two
Poids by comparing their fields. |
boolean |
equals(java.lang.Object o)
Object.equals() override.
|
boolean |
equals(Poid that)
Compares the database, type, and ID of two
Poids to determine
if they refer to the same storable class instance. |
long |
getDb()
Returns the object's database number specified in the
Poid. |
long |
getId()
Returns the object ID specified in the
Poid. |
long |
getRev()
Returns the object's revision level specified in the
Poid. |
java.lang.String |
getType()
Returns the object's storable class type name specified in the
Poid. |
int |
hashCode()
Object.hashCode override
|
boolean |
isNull()
Checks for 'null poid' - defined as: 0 / 0 0
|
boolean |
isSameSchema(Poid other)
This is to find whether the given two poids have the
same schema or not.
|
java.lang.String |
toString()
Converts the
Poid to a string. |
static Poid |
valueOf(java.lang.String str)
Returns a new
Poid with the values specified in the
str parameter. |
static Poid |
valueOf(java.lang.String str,
long defaultDatabase)
Returns a new
Poid with the values specified in the
str parameter. |
public static final Poid NULL_POID
public Poid(long db,
long id,
java.lang.String type)
Poid from a database ID,
object ID, and type string. The revision level is initialized to 0.db - The object's database number.id - The unique object ID number.type - The object's storable class type. For example, /account.public Poid(long db,
long id,
java.lang.String type,
int rev)
Poid from a database ID,
object ID, type string, and revision level.db - The object's database number.id - The unique object ID number.type - The object's storable class type.rev - The object's revision level.public Poid(long db,
long id)
Poid from a database ID
and an object ID.db - The object's database number.id - The unique object ID number.public Poid(long db)
Poid from a database ID.db - The object's database number.public long getDb()
Poid.public java.lang.String getType()
Poid. For example, /event/billing/invoice.public long getId()
Poid.public long getRev()
Poid.public boolean isSameSchema(Poid other)
<RES>.<LP_NO>.<RES>.<SCHEMA_NO> ),
have the same <SCHEMA_NO>.other - A second Poid to compare.public int compareTo(Poid other)
Poids by comparing their fields.
The fields are compared in this order: db, type, id, rev.
NOTE: While comparing db, lp number would be ignored. To consider lp number,
compareToWithLp API needs to be used.
The result is returned when the first inequality is encountered.other - A second Poid to compare.Poid passed in is first in the sort,
-1 if the Poid passed in is second in the sort,
or 0 if the Poids sort equally.public int compareToWithLp(Poid other)
Poids by comparing their fields.
The fields are compared in this order: db, type, id, rev.
The result is returned when the first inequality is encountered.
NOTE: While comparing db, lp number would be considered. To ignore lp number,
compareTo API needs to be used.other - A second Poid to compare.Poid passed in is first in the sort,
-1 if the Poid passed in is second in the sort,
or 0 if the Poids sort equally.public boolean equals(Poid that)
Poids to determine
if they refer to the same storable class instance.that - A second Poid to compare.true if the two Poids refer to the same
storable class, otherwise, returns false.public boolean equals(java.lang.Object o)
Poids to determine
if they refer to the same storable class instance.
This method calls the equals(Poid that) method after verifying
the object passed in is an instance of Poid.equals in class java.lang.Objecto - The Poid to compare.true if the two Poids have the
same database, type, and ID. If the o parameter is not
an instance of Poid, false is returned.public int hashCode()
hashCode in class java.lang.Objectpublic boolean isNull()
true if the Poid is a null object reference.public java.lang.String toString()
Poid to a string.toString in class java.lang.ObjectPoid. For example,
"0.0.0.1 /account 1234 0".public static Poid valueOf(java.lang.String str, long defaultDatabase)
Poid with the values specified in the
str parameter.str - A String representation of a Poid. For example,
"0.0.0.1 /account 1234 0". The database portion of the string can be
specified as '$DB' if you want to use the defaultDatabase
parameter. For example. "$DB /account 1234 0".defaultDatabase - A specified database number. If the
str parameter contains the substring '$DB', the database
number specified in this parameter will replace it. For example:
defaultDatabase = 0.0.0.2
str = "$DB /account 4567 0"
Resulting Poid = "0.0.0.2 /account 4567 0"
If the str parameter contains a
database number, the defaultDatabase parameter is ignored.Poid initialized with the values specified by
the string.public static Poid valueOf(java.lang.String str)
Poid with the values specified in the
str parameter.str - A string representation of a Poid.
For example, "0.0.0.1 /account 1234 0"Poid initialized with the values specified by the
string.