Class AnonymousIdentity

  • All Implemented Interfaces:
    Identity


    public class AnonymousIdentity
    extends java.lang.Object
    implements Identity

    This class models an identity which is used to identify an End User within a Zendesk instance.
    Please use the AnonymousIdentity.Builder to create an instance of this class. A UUID will be created if necessary and associated with the identity.

    If you don't know anything about your user please create an Identity like this:

              Identity identity = new AnonymousIdentity.Builder().build();
          

    If you do know something about the user then you can use the optional methods in the builder to specify them. If you specify an external id you must ensure that this is a global identifier for that user.

    See Also:
    Anonymous access docs on developer.zendesk.com
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      static class  AnonymousIdentity.Builder
      This is a builder class which is used to generate a Identity
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method and Description
      boolean equals(java.lang.Object o) 
      java.lang.String getEmail()
      Gets the email address associated with this anonymous identity
      java.lang.String getExternalId()
      Deprecated. 
      Deprecated in 1.8.0.1. This will be removed in the next release. You will need to use JWT authentication if you want to use external IDs
      java.lang.String getName()
      Gets the name associated with this anonymous identity
      java.lang.String getSdkGuid()
      Gets the sdk guid associated with this anonymous identity
      int hashCode() 
      void reloadGuid()
      Ensures that the Anonymous ticket has a GUID.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • equals

        public boolean equals(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • getEmail

        public java.lang.String getEmail()
        Gets the email address associated with this anonymous identity
        Returns:
        The email address or null if it was not set
      • getName

        public java.lang.String getName()
        Gets the name associated with this anonymous identity
        Returns:
        The name or null if it was not set
      • getExternalId

        @Deprecated
        public java.lang.String getExternalId()
        Deprecated. Deprecated in 1.8.0.1. This will be removed in the next release. You will need to use JWT authentication if you want to use external IDs
        Gets the external id associated with this anonymous identity
        Returns:
        The external id or null if it was not set
      • getSdkGuid

        public java.lang.String getSdkGuid()
        Gets the sdk guid associated with this anonymous identity
        Returns:
        The sdk guid
      • reloadGuid

        public void reloadGuid()
        Ensures that the Anonymous ticket has a GUID.

        If the GUID is missing a new one will be generated. Otherwise this method will ensure that the GUID is refreshed from storage.