Package cloud.commandframework.keys
Class SimpleCloudKey<T>
java.lang.Object
cloud.commandframework.keys.SimpleCloudKey<T>
- Type Parameters:
T
- Key type
- All Implemented Interfaces:
CloudKey<T>
Simple immutable implementation of
CloudKey
. Key equality is
determined solely by the key name. Two keys with matching names will
be equal, no matter if their type tokens are identical.- Since:
- 1.4.0
-
Method Summary
Modifier and TypeMethodDescriptionboolean
@NonNull String
getName()
Get the name of the key.@NonNull io.leangen.geantyref.TypeToken<T>
getType()
Get the type of the value that this key holds.int
hashCode()
Create a new type-less simple cloud keystatic <@NonNull T>
CloudKey<T>Create a new simple cloud keytoString()
-
Method Details
-
of
public static <@NonNull T> CloudKey<T> of(@NonNull String name, @NonNull io.leangen.geantyref.TypeToken<@NonNull T> type)Create a new simple cloud key- Type Parameters:
T
- The generic type of the value represented by the key- Parameters:
name
- The name of the keytype
- The type of the value represented by the key- Returns:
- The created key instance
-
of
Create a new type-less simple cloud key- Parameters:
name
- The name of the key- Returns:
- The created key instance
-
getName
Description copied from interface:CloudKey
Get the name of the key. The name of the key should be used to determine key equality. That means that two keys sharing the same name are equal. -
getType
Description copied from interface:CloudKey
Get the type of the value that this key holds. -
equals
-
hashCode
public int hashCode() -
toString
-