Package io.dapr.actors

# Class ActorId

java.lang.Object
io.dapr.actors.ActorId

All Implemented Interfaces:
  `java.lang.Comparable<ActorId>`

    public class ActorId
    extends java.lang.Object
    implements java.lang.Comparable<ActorId>

The ActorId represents the identity of an actor within an actor service.

- ## Constructor Summary

  Constructors
  Constructor | Description
  --- | ---
  `ActorId​(java.lang.String id)` | Initializes a new instance of the ActorId class with the id passed in.

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `int` | `compareTo​(ActorId other)` | Compares this instance with a specified {link #ActorId} object and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified actorId.
  `static ActorId` | `createRandom()` | Creates a new ActorId with a random id.
  `boolean` | `equals​(java.lang.Object obj)` | Checks if this instance is equals to the other instance.
  `int` | `hashCode()` | Calculates the hash code for this ActorId.
  `java.lang.String` | `toString()` | Returns the String representation of this Actor's identifier.

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### ActorId

    public ActorId​(java.lang.String id)
    Initializes a new instance of the ActorId class with the id passed in.
    Parameters:
      `id` - Value for actor id

- ## Method Details

  - ### toString

    public java.lang.String toString()
    Returns the String representation of this Actor's identifier.
    Overrides:
      `toString` in class `java.lang.Object`
    Returns:
      The String representation of this ActorId

  - ### compareTo

    public int compareTo​(ActorId other)
    Compares this instance with a specified {link #ActorId} object and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified actorId. The comparison is done based on the id if both the instances.
    Specified by:
      `compareTo` in interface `java.lang.Comparable<ActorId>`
    Parameters:
      `other` - The actorId to compare with this instance.
    Returns:
      A 32-bit signed integer that indicates whether this instance precedes, follows, or appears in the same position in the sort order as the other parameter.

  - ### hashCode

    public int hashCode()
    Calculates the hash code for this ActorId.
    Overrides:
      `hashCode` in class `java.lang.Object`
    Returns:
      The hash code of this ActorId.

  - ### equals

    public boolean equals​(java.lang.Object obj)
    Checks if this instance is equals to the other instance.
    Overrides:
      `equals` in class `java.lang.Object`
    Returns:
      true if the 2 ActorId's are equal.

  - ### createRandom

    public static ActorId createRandom()
    Creates a new ActorId with a random id.
    Returns:
      A new ActorId with a random id.