public class Poid extends Object implements 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,
String type)
Constructs a complete
Poid from a database ID,
object ID, and type string. |
Poid(long db,
long id,
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
Poid s by comparing their fields. |
int |
compareToWithLp(Poid other)
Determines the sort order of two
Poid s by comparing their fields. |
boolean |
equals(Object o)
Object.equals() override.
|
boolean |
equals(Poid that)
Compares the database, type, and ID of two
Poid s 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 . |
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.
|
String |
toString()
Converts the
Poid to a string. |
static Poid |
valueOf(String str)
Returns a new
Poid with the values specified in the
str parameter. |
static Poid |
valueOf(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, 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, 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 String getType()
Poid
. For example, /event/billing/invoice.public long getId()
Poid
.public long getRev()
Poid
.public boolean isSameSchema(Poid other)
other
- A second Poid
to compare.public int compareTo(Poid other)
Poid
s 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 Poid
s sort equally.public int compareToWithLp(Poid other)
Poid
s 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 Poid
s sort equally.public boolean equals(Poid that)
Poid
s to determine
if they refer to the same storable class instance.that
- A second Poid
to compare.true
if the two Poid
s refer to the same
storable class, otherwise, returns false
.public boolean equals(Object o)
Poid
s 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
.public int hashCode()
public boolean isNull()
true
if the Poid
is a null object reference.public String toString()
Poid
to a string.public static Poid valueOf(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.Copyright © 2003, 2023, Oracle and/or its affiliates.