Package com.atlassian.bamboo.core
Class BambooEntityOid
- java.lang.Object
-
- com.atlassian.bamboo.core.BambooEntityOid
-
- All Implemented Interfaces:
WhitelistedSerializable,Serializable
@Immutable public final class BambooEntityOid extends Object implements WhitelistedSerializable
Unique identifier assigned to Bamboo entities. Information encoded into OID include Bamboo server unique key and entity type, as well as this entity's unique number.
-
-
Field Summary
Fields Modifier and Type Field Description static intSERVER_BITS_MASKstatic intSERVER_BITS_NUMBER
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BambooEntityOidcreate(int serverKey, @NotNull BambooEntityType type, long entityOid)Create a new OID object instance based on server key, entity type and entity oid (unique within the server, within entity type).static BambooEntityOidcreate(long oid)Create a new OID object instance from it's serialized representation.static BambooEntityOidcreateFromExternalValue(String externalValue)booleanequals(Object o)longgetEntityOid()Return unique entity OID from this OID object.@NotNull BambooEntityTypegetEntityType()Return entity type represented by this OID.intgetServerKey()Return server key represented by this OID.longgetValue()Returns the serialized representation of this OID object.inthashCode()static @NotNull BambooEntityOidmaxOidOfType(int serverKey, @NotNull BambooEntityType type)Obtain maximal allowed entity OID for the given server key and entity type.static @NotNull BambooEntityOidminOidOfType(int serverKey, @NotNull BambooEntityType type)Obtain minimal allowed entity OID for the given server key and entity type.StringtoExternalValue()StringtoString()
-
-
-
Field Detail
-
SERVER_BITS_NUMBER
public static final int SERVER_BITS_NUMBER
- See Also:
- Constant Field Values
-
SERVER_BITS_MASK
public static final int SERVER_BITS_MASK
-
-
Method Detail
-
create
public static BambooEntityOid create(long oid)
Create a new OID object instance from it's serialized representation.- Parameters:
oid- serialized OID- Throws:
IllegalArgumentException- if the OID is invalid
-
create
public static BambooEntityOid create(int serverKey, @NotNull @NotNull BambooEntityType type, long entityOid)
Create a new OID object instance based on server key, entity type and entity oid (unique within the server, within entity type).- Parameters:
serverKey- server keytype- entity typeentityOid- OID of this entity within the server and the type- Throws:
IllegalArgumentException- if the server key or entity OID are invalid
-
createFromExternalValue
public static BambooEntityOid createFromExternalValue(String externalValue)
-
minOidOfType
@NotNull public static @NotNull BambooEntityOid minOidOfType(int serverKey, @NotNull @NotNull BambooEntityType type)
Obtain minimal allowed entity OID for the given server key and entity type.
-
maxOidOfType
@NotNull public static @NotNull BambooEntityOid maxOidOfType(int serverKey, @NotNull @NotNull BambooEntityType type)
Obtain maximal allowed entity OID for the given server key and entity type.
-
toExternalValue
public String toExternalValue()
-
getServerKey
public int getServerKey()
Return server key represented by this OID.
-
getEntityType
@NotNull public @NotNull BambooEntityType getEntityType()
Return entity type represented by this OID.
-
getEntityOid
public long getEntityOid()
Return unique entity OID from this OID object. The returned value is unique within the server, within entity type.- See Also:
getServerKey(),getEntityType()
-
getValue
public long getValue()
Returns the serialized representation of this OID object.
-
-