ActorId Class
- java.
lang. Object - Comparable<ActorId>
- microsoft.
servicefabric. actors. ActorId
- microsoft.
public class ActorId
ActorId represents identity of an actor within an actor service. The actors can be identified by java.lang.String, java.util.UUID or long.
Constructor Summary
Constructor | Description |
---|---|
ActorId(long id) |
Initializes a new instance of ActorId class with Id value of type long |
ActorId(String id) |
Initializes a new instance of ActorId class with Id value of type java.lang.String. |
ActorId(UUID id) |
Initializes a new instance of ActorId class with Id value of type java.util.UUID |
Method Summary
Modifier and Type | Method and Description |
---|---|
int |
compareTo(ActorId o)
Compares this instance with a specified ActorId object and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified actorId.
Remarks:The comparison is done based on the id if both the instances have same ActorIdKind. If ActorIdKind is different, then comparison is done based on string representation of the actor id. |
boolean |
equals(Object obj)
Determines whether this instance and a specified object, which must also be a ActorId object, have the same value. |
Actor |
getKind()
Gets the ActorIdKind for the ActorId. |
long |
getLongId()
Gets id for ActorId whose ActorIdKind is Long. |
long |
getPartitionKey()
Gets partition key for the ActorId.
Remarks:
|
String |
getStringId()
Gets id for ActorId whose ActorIdKind is String. |
UUID |
getUUIDId()
Gets id for ActorId whose ActorIdKind is UUID. |
int | hashCode() |
Actor |
newId()
creates a random actor Id. |
String | toString() |
Constructor Details
ActorId
public ActorId(long id)
Initializes a new instance of ActorId class with Id value of type long
Parameters:
ActorId
public ActorId(String id)
Initializes a new instance of ActorId class with Id value of type java.lang.String.
Parameters:
ActorId
public ActorId(UUID id)
Initializes a new instance of ActorId class with Id value of type java.util.UUID
Parameters:
Method Details
compareTo
public int compareTo(ActorId o)
Compares this instance with a specified ActorId object and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified actorId.
Remarks:The comparison is done based on the id if both the instances have same ActorIdKind. If ActorIdKind is different, then comparison is done based on string representation of the actor id.
Parameters:
Returns:
equals
public boolean equals(Object obj)
Determines whether this instance and a specified object, which must also be a ActorId object, have the same value.
Parameters:
Returns:
getKind
public ActorIdKind getKind()
Gets the ActorIdKind for the ActorId.
Returns:
ActorIdKind for the ActorId.
getLongId
public long getLongId()
Gets id for ActorId whose ActorIdKind is Long.
Returns:
getPartitionKey
public long getPartitionKey()
Gets partition key for the ActorId.
Remarks:
<li>
<p>The actor service is always partitioned using uniform Integer64 partition scheme. Therefore the partition key is of long type. </p>
</li>
<li>
<p>The partition key is generated based on the <xref uid="microsoft.servicefabric.actors.ActorIdKind" data-throw-if-not-resolved="false" data-raw-source="ActorIdKind"></xref> and the id value as follows: <ul><li><p>a. ActorIdKind.String : CRC64 hash of the UTF8 bytes of the string id. </p></li><li><p>ActorIdKind.Guid: CRC64 hash of the bytes of the guid id. </p></li><li><p>ActorIdKind.Long: Actual value of the long id. </p></li></ul></p>
</li>
Returns:
getStringId
public String getStringId()
Gets id for ActorId whose ActorIdKind is String.
Returns:
getUUIDId
public UUID getUUIDId()
Gets id for ActorId whose ActorIdKind is UUID.
Returns:
java.util.UUID id value for ActorId.
hashCode
public int hashCode()
Returns:
newId
public static ActorId newId()
creates a random actor Id.
Returns:
toString
public String toString()
Returns:
Applies to
Azure SDK for Java