Class ServiceNameHelper

java.lang.Object
com.peterphi.std.guice.restclient.resteasy.impl.ServiceNameHelper

public class ServiceNameHelper extends Object
  • Constructor Details

    • ServiceNameHelper

      public ServiceNameHelper()
  • Method Details

    • getName

      public static String getName(GuiceConfig config, Class<?> iface, String... names)
      Get the name under which a given service interface is known
      Parameters:
      config -
      iface - the service interface; if unspecified then
      names - optional (may be null or empty) set of names to try
      Returns:
    • getServiceNames

      public static String[] getServiceNames(Class<?> iface)
      Computes the default set of names for a service based on an interface class. The names produced are an ordered list:
      • The fully qualified class name
      • If present, the ServiceName annotation on the class (OR if not specified on the class, the ServiceName specified on the package)
      • The simple name of the class (the class name without the package prefix)
      Parameters:
      iface - a JAX-RS service interface
      Returns:
      An array containing one or more names that could be used for the class; may contain nulls (which should be ignored)