Package org.incendo.cloud.key
Class CloudKey<T>
java.lang.Object
org.incendo.cloud.key.CloudKey<T>
- Type Parameters:
T- The type of the key
A typed, named key.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a new type-less key.static <T> CloudKey<T> Creates a new key.static <T> CloudKey<T> Creates a new key.final booleanfinal inthashCode()name()Returns the name of the key.Creates a new type-less key.static <T> CloudKey<T> Creates a new key.static <T> CloudKey<T> Creates a new key.type()Returns the type of the value that this key holds.
-
Constructor Details
-
CloudKey
public CloudKey()
-
-
Method Details
-
of
@API(status=STABLE) public static <T> CloudKey<T> of(@NonNull String name, @NonNull TypeToken<T> type) Creates a new 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
-
of
Creates a new 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
-
of
Creates a new type-less key.- Parameters:
name- the name of the key- Returns:
- the created key
-
cloudKey
@API(status=STABLE) public static <T> CloudKey<T> cloudKey(@NonNull String name, @NonNull TypeToken<T> type) Creates a new 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
-
cloudKey
@API(status=STABLE) public static <T> CloudKey<T> cloudKey(@NonNull String name, @NonNull Class<T> type) Creates a new 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
-
cloudKey
Creates a new type-less key.- Parameters:
name- the name of the key- Returns:
- the created key
-
name
Returns 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 considered equal.
- Returns:
- the name of the key
-
type
Returns the type of the value that this key holds.- Returns:
- the type of the key value.
-
equals
-
hashCode
public final int hashCode()
-