Enum ProductType
- java.lang.Object
-
- java.lang.Enum<ProductType>
-
- ru.easydonate.easydonate4j.api.v3.data.model.shop.ProductType
-
- All Implemented Interfaces:
Serializable
,Comparable<ProductType>
public enum ProductType extends Enum<ProductType>
The enum that represents all possible and actual product types.- Author:
- soknight
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CASE
Represents a roulette (one of items with custom chance).CURRENCY
Represents a virtual currency.ITEM
Represents an in-game item.OTHER
Represents a product without category.PRIVILEGE
Represents a privilege (permissions group).UNKNOWN
Represents a product type that isn't known yet.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static @NotNull ProductType
getByKey(@Nullable String key)
Get the enum constant by the known product type key (can be null).static ProductType
valueOf(String name)
Returns the enum constant of this type with the specified name.static ProductType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ITEM
public static final ProductType ITEM
Represents an in-game item.
-
PRIVILEGE
public static final ProductType PRIVILEGE
Represents a privilege (permissions group).
-
CURRENCY
public static final ProductType CURRENCY
Represents a virtual currency.
-
CASE
public static final ProductType CASE
Represents a roulette (one of items with custom chance).
-
OTHER
public static final ProductType OTHER
Represents a product without category.
-
UNKNOWN
public static final ProductType UNKNOWN
Represents a product type that isn't known yet.
-
-
Method Detail
-
values
public static ProductType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ProductType c : ProductType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ProductType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
getByKey
@NotNull public static @NotNull ProductType getByKey(@Nullable @Nullable String key)
Get the enum constant by the known product type key (can be null).
If the key is null/empty or relevant enum constant with this key will not be found then this method will returnUNKNOWN
constant as default.- Parameters:
key
- the product type key to find an enum constant.- Returns:
- The found product type enum constant or
UNKNOWN
by default.
-
-