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 partialPoidfrom a database ID.Poid(long db, long id) Constructs a partialPoidfrom a database ID and an object ID.Constructs a completePoidfrom a database ID, object ID, and type string.Constructs a completePoidfrom a database ID, object ID, type string, and revision level. -
Method Summary
Modifier and TypeMethodDescriptionintDetermines the sort order of twoPoids by comparing their fields.intcompareToWithLp(Poid other) Determines the sort order of twoPoids by comparing their fields.booleanCompares the database, type, and ID of twoPoids to determine if they refer to the same storable class instance.booleanObject.equals() override.longgetDb()Returns the object's database number specified in thePoid.longgetId()Returns the object ID specified in thePoid.longgetRev()Returns the object's revision level specified in thePoid.getType()Returns the object's storable class type name specified in thePoid.inthashCode()Object.hashCode overridebooleanisNull()Checks for 'null poid' - defined as: 0 / 0 0booleanisSameSchema(Poid other) This is to find whether the given two poids have the same schema or not.toString()Converts thePoidto a string.static PoidReturns a newPoidwith the values specified in thestrparameter.static PoidReturns a newPoidwith the values specified in thestrparameter.
-
Field Details
-
NULL_POID
-
-
Constructor Details
-
Poid
Constructs a completePoidfrom 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 completePoidfrom 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 partialPoidfrom 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 partialPoidfrom 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 secondPoidto compare.- Returns:
- true if the Poids have the same schema number.
-
compareTo
Determines the sort order of twoPoids 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 secondPoidto compare.- Returns:
- 1 if the
Poidpassed in is first in the sort, -1 if thePoidpassed in is second in the sort, or 0 if thePoids sort equally.
-
compareToWithLp
Determines the sort order of twoPoids 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 secondPoidto compare.- Returns:
- 1 if the
Poidpassed in is first in the sort, -1 if thePoidpassed in is second in the sort, or 0 if thePoids sort equally.
-
equals
Compares the database, type, and ID of twoPoids to determine if they refer to the same storable class instance.- Parameters:
that- A secondPoidto compare.- Returns:
trueif the twoPoids refer to the same storable class, otherwise, returnsfalse.
-
equals
Object.equals() override. Compares the database, type, and ID of twoPoids 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:
trueif thePoidis a null object reference.
-
toString
Converts thePoidto a string. -
valueOf
Returns a newPoidwith the values specified in thestrparameter.- 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 thedefaultDatabaseparameter. For example. "$DB /account 1234 0".defaultDatabase- A specified database number. If thestrparameter 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"strparameter contains a database number, thedefaultDatabaseparameter is ignored.- Returns:
- A new
Poidinitialized with the values specified by the string.
-
valueOf
Returns a newPoidwith the values specified in thestrparameter.- Parameters:
str- A string representation of aPoid. For example, "0.0.0.1 /account 1234 0"- Returns:
- A new
Poidinitialized with the values specified by the string.
-