Enum Class GravatarUrlParameter

java.lang.Object
java.lang.Enum<GravatarUrlParameter>
com.github.natche.gravatarjavaclient.enums.GravatarUrlParameter
All Implemented Interfaces:
Serializable, Comparable<GravatarUrlParameter>, Constable

public enum GravatarUrlParameter extends Enum<GravatarUrlParameter>
A URL parameter for a Gravatar Avatar request.
  • Enum Constant Details

  • Method Details

    • values

      public static GravatarUrlParameter[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static GravatarUrlParameter valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • constructUrlParameterWithValue

      public <T> String constructUrlParameterWithValue(T value, GravatarUseFullUrlParameters useFullUrlParameter)
      Constructs a string for this URL parameter with the provided value. It is assumed this is NOT the first URL parameter after the path in the URL.
      Type Parameters:
      T - the type of value
      Parameters:
      value - the value
      useFullUrlParameter - whether to use the full URL parameter
      Returns:
      the string for this URL parameter and value
      Throws:
      NullPointerException - if any provided parameter is null
    • constructUrlParameterWithValue

      public <T> String constructUrlParameterWithValue(T value, boolean firstParameter, GravatarUseFullUrlParameters useFullUrlParameter)
      Constructs a string for this URL parameter with the provided value. If this is the first parameter after the query, a "?" character is the leading character. Otherwise, a "&" character is the leading character.
      Type Parameters:
      T - the type of value
      Parameters:
      value - the value
      firstParameter - whether this URL parameter is the first after the query
      useFullUrlParameter - whether to use the full URL parameter
      Returns:
      the string for this URL parameter and value
      Throws:
      NullPointerException - if any provided parameter is null