Enum Class GravatarUrlParameter
java.lang.Object
java.lang.Enum<GravatarUrlParameter>
com.github.natche.gravatarjavaclient.enums.GravatarUrlParameter
- All Implemented Interfaces:
Serializable,Comparable<GravatarUrlParameter>,Constable
A URL parameter for a Gravatar Avatar request.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionTheGravatarDefaultImageTypetype.The URL of the default image to return in the case a user email hash is invalid or results in no valid images.Whether to force the default URL regardless of the validity of the user account hash.TheGravatarRatingfor a Gravatar request.The size of the image to be returned by a Gravatar request. -
Method Summary
Modifier and TypeMethodDescription<T> StringconstructUrlParameterWithValue(T value, boolean firstParameter, GravatarUseFullUrlParameters useFullUrlParameter) Constructs a string for this URL parameter with the provided value.<T> StringconstructUrlParameterWithValue(T value, GravatarUseFullUrlParameters useFullUrlParameter) Constructs a string for this URL parameter with the provided value.static GravatarUrlParameterReturns the enum constant of this class with the specified name.static GravatarUrlParameter[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
Size
The size of the image to be returned by a Gravatar request. -
DefaultImageUrl
The URL of the default image to return in the case a user email hash is invalid or results in no valid images. -
ForceDefault
Whether to force the default URL regardless of the validity of the user account hash. SeeGravatarForceDefaultImage. -
DefaultImageType
TheGravatarDefaultImageTypetype. Used to return a random custom avatar if a user's email hash cannot be located. -
Rating
TheGravatarRatingfor a Gravatar request.
-
-
Method Details
-
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
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 nameNullPointerException- 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 valueuseFullUrlParameter- 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 valuefirstParameter- whether this URL parameter is the first after the queryuseFullUrlParameter- whether to use the full URL parameter- Returns:
- the string for this URL parameter and value
- Throws:
NullPointerException- if any provided parameter is null
-