Module io.jooby
Package io.jooby

Class ServiceKey<T>

java.lang.Object
io.jooby.ServiceKey<T>
Type Parameters:
T - Service type.

public final class ServiceKey<T> extends Object
Utility class to access application services.
  • Method Details

    • getType

      @NonNull public Class<T> getType()
      Resource type.
      Returns:
      Resource type.
    • getName

      @Nullable public String getName()
      Resource name or null.
      Returns:
      Resource name or null.
    • equals

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

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

      public String toString()
      Overrides:
      toString in class Object
    • key

      @NonNull public static <T> ServiceKey<T> key(@NonNull Class<T> type)
      Creates a resource key.
      Type Parameters:
      T - Type.
      Parameters:
      type - Resource type.
      Returns:
      A new resource key.
    • key

      @NonNull public static <T> ServiceKey<T> key(@NonNull Class<T> type, @NonNull String name)
      Creates a named resource key.
      Type Parameters:
      T - Type.
      Parameters:
      type - Resource type.
      name - Resource name.
      Returns:
      A new resource key.