Class CloudKey<T>

java.lang.Object
org.incendo.cloud.key.CloudKey<T>
Type Parameters:
T - The type of the key

@Immutable @API(status=STABLE) public abstract class CloudKey<T> extends Object
A typed, named key.
  • 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 key
      type - the type of the value represented by the key
      Returns:
      the created key
    • of

      @API(status=STABLE) public static <T> CloudKey<T> of(@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 key
      type - the type of the value represented by the key
      Returns:
      the created key
    • of

      @API(status=STABLE) public static @NonNull CloudKey<Void> of(@NonNull String name)
      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 key
      type - 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 key
      type - the type of the value represented by the key
      Returns:
      the created key
    • cloudKey

      @API(status=STABLE) public static @NonNull CloudKey<Void> cloudKey(@NonNull String name)
      Creates a new type-less key.
      Parameters:
      name - the name of the key
      Returns:
      the created key
    • name

      public abstract @NonNull String 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

      public abstract @NonNull TypeToken<@NonNull T> type()
      Returns the type of the value that this key holds.
      Returns:
      the type of the key value.
    • equals

      public final boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object