Class GravatarProfileTokenProvider

java.lang.Object
com.github.natche.gravatarjavaclient.profile.GravatarProfileTokenProvider

public final class GravatarProfileTokenProvider extends Object
An authentication token provider for Gravatar Profile requests.
  • Constructor Details

    • GravatarProfileTokenProvider

      public GravatarProfileTokenProvider(Supplier<byte[]> tokenProvider, String source)
      Constructs a new token provider.
      Parameters:
      tokenProvider - the supplier for producing an API token as a byte array
      source - the source/key, this is used for hash and equals comparisons
      Throws:
      NullPointerException - if any parameter is null
      IllegalArgumentException - if source is empty
  • Method Details

    • getToken

      public byte[] getToken()
      Returns the token.
      Returns:
      the token
    • hashCode

      public int hashCode()
      Returns a hashcode representation of this object.
      Overrides:
      hashCode in class Object
      Returns:
      a hashcode representation of this object
    • equals

      public boolean equals(Object o)
      Returns whether the provided object equals this.
      Overrides:
      equals in class Object
      Parameters:
      o - the other object
      Returns:
      whether the provided object equals this
    • toString

      public String toString()
      Returns a string representation of this object.
      Overrides:
      toString in class Object
      Returns:
      a string representation of this object