Class SimpleCloudKey<T>

  • Type Parameters:
    T - Key type
    All Implemented Interfaces:
    CloudKey<T>

    public final class SimpleCloudKey<@NonNull T>
    extends java.lang.Object
    implements 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

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      @NonNull java.lang.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()  
      static @NonNull CloudKey<java.lang.Void> of​(@NonNull java.lang.String name)
      Create a new type-less simple cloud key
      static <@NonNull T>
      CloudKey<T>
      of​(@NonNull java.lang.String name, @NonNull io.leangen.geantyref.TypeToken<@NonNull T> type)
      Create a new simple cloud key
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • of

        public static <@NonNull T> CloudKey<T> of​(@NonNull java.lang.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 key
        type - The type of the value represented by the key
        Returns:
        The created key instance
      • of

        public static @NonNull CloudKey<java.lang.Void> of​(@NonNull java.lang.String name)
        Create a new type-less simple cloud key
        Parameters:
        name - The name of the key
        Returns:
        The created key instance
      • getName

        public @NonNull java.lang.String 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.
        Specified by:
        getName in interface CloudKey<T>
        Returns:
        The key name
      • getType

        public @NonNull io.leangen.geantyref.TypeToken<T> getType()
        Description copied from interface: CloudKey
        Get the type of the value that this key holds.
        Specified by:
        getType in interface CloudKey<T>
        Returns:
        The type of the key value.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object