Package com.portal.pcm
Class Poid
java.lang.Object
com.portal.pcm.Poid
- All Implemented Interfaces:
Serializable
The
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.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPoid
(long db) Constructs a partialPoid
from a database ID.Poid
(long db, long id) Constructs a partialPoid
from a database ID and an object ID.Constructs a completePoid
from a database ID, object ID, and type string.Constructs a completePoid
from a database ID, object ID, type string, and revision level. -
Method Summary
Modifier and TypeMethodDescriptionint
Determines the sort order of twoPoid
s by comparing their fields.int
compareToWithLp
(Poid other) Determines the sort order of twoPoid
s by comparing their fields.boolean
Compares the database, type, and ID of twoPoid
s to determine if they refer to the same storable class instance.boolean
Object.equals() override.long
getDb()
Returns the object's database number specified in thePoid
.long
getId()
Returns the object ID specified in thePoid
.long
getRev()
Returns the object's revision level specified in thePoid
.getType()
Returns the object's storable class type name specified in thePoid
.int
hashCode()
Object.hashCode overrideboolean
isNull()
Checks for 'null poid' - defined as: 0 / 0 0boolean
isSameSchema
(Poid other) This is to find whether the given two poids have the same schema or not.toString()
Converts thePoid
to a string.static Poid
Returns a newPoid
with the values specified in thestr
parameter.static Poid
Returns a newPoid
with the values specified in thestr
parameter.
-
Field Details
-
NULL_POID
-
-
Constructor Details
-
Poid
Constructs a completePoid
from a database ID, object ID, and type string. The revision level is initialized to 0.- Parameters:
db
- The object's database number.id
- The unique object ID number.type
- The object's storable class type. For example, /account.
-
Poid
Constructs a completePoid
from a database ID, object ID, type string, and revision level.- Parameters:
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.
-
Poid
public Poid(long db, long id) Constructs a partialPoid
from a database ID and an object ID.- Parameters:
db
- The object's database number.id
- The unique object ID number.
-
Poid
public Poid(long db) Constructs a partialPoid
from a database ID.- Parameters:
db
- The object's database number.
-
-
Method Details
-
getDb
public long getDb()Returns the object's database number specified in thePoid
.- Returns:
- The database number.
-
getType
Returns the object's storable class type name specified in thePoid
. For example, /event/billing/invoice.- Returns:
- The storable class type name.
-
getId
public long getId()Returns the object ID specified in thePoid
.- Returns:
- The object ID.
-
getRev
public long getRev()Returns the object's revision level specified in thePoid
.- Returns:
- the object's revision level.
-
isSameSchema
This is to find whether the given two poids have the same schema or not. Two poids considered to be having same schema number if their DB_NO (<RES>.<LP_NO>.<RES>.<SCHEMA_NO>
), have the same<SCHEMA_NO>
.- Parameters:
other
- A secondPoid
to compare.- Returns:
- true if the Poids have the same schema number.
-
compareTo
Determines the sort order of twoPoid
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.- Parameters:
other
- A secondPoid
to compare.- Returns:
- 1 if the
Poid
passed in is first in the sort, -1 if thePoid
passed in is second in the sort, or 0 if thePoid
s sort equally.
-
compareToWithLp
Determines the sort order of twoPoid
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.- Parameters:
other
- A secondPoid
to compare.- Returns:
- 1 if the
Poid
passed in is first in the sort, -1 if thePoid
passed in is second in the sort, or 0 if thePoid
s sort equally.
-
equals
Compares the database, type, and ID of twoPoid
s to determine if they refer to the same storable class instance.- Parameters:
that
- A secondPoid
to compare.- Returns:
true
if the twoPoid
s refer to the same storable class, otherwise, returnsfalse
.
-
equals
Object.equals() override. Compares the database, type, and ID of twoPoid
s to determine if they refer to the same storable class instance. This method calls theequals(Poid that)
method after verifying the object passed in is an instance ofPoid
. -
hashCode
public int hashCode()Object.hashCode override -
isNull
public boolean isNull()Checks for 'null poid' - defined as: 0 / 0 0- Returns:
true
if thePoid
is a null object reference.
-
toString
Converts thePoid
to a string. -
valueOf
Returns a newPoid
with the values specified in thestr
parameter.- Parameters:
str
- A String representation of aPoid
. 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 thedefaultDatabase
parameter. For example. "$DB /account 1234 0".defaultDatabase
- A specified database number. If thestr
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
If thePoid
= "0.0.0.2 /account 4567 0"str
parameter contains a database number, thedefaultDatabase
parameter is ignored.- Returns:
- A new
Poid
initialized with the values specified by the string.
-
valueOf
Returns a newPoid
with the values specified in thestr
parameter.- Parameters:
str
- A string representation of aPoid
. For example, "0.0.0.1 /account 1234 0"- Returns:
- A new
Poid
initialized with the values specified by the string.
-