@Test public void testRegister() { DeploymentHandler h = new DeploymentHandler(); Handlers.unregister(h); Handlers.register(h); assertSame(h, Handlers.get(h.getKind(), h.getApiVersion())); }
public static <T extends HasMetadata, V extends VisitableBuilder<T, V>> void register(ResourceHandler<T,V> handler) { RESOURCE_HANDLER_MAP.put(new ResourceHandler.Key(handler.getKind().toLowerCase(Locale.ROOT), handler.getApiVersion()), handler); }
Handlers { public static <T extends HasMetadata, V extends VisitableBuilder<T, V>> void register(ResourceHandler<T,V> handler) { RESOURCE_HANDLER_MAP.put(new ResourceHandler.Key(handler.getKind().toLowerCase(Locale.ROOT), handler.getApiVersion()), handler); } }
Handlers { public static <T extends HasMetadata, V extends VisitableBuilder<T, V>> void register(ResourceHandler<T,V> handler) { RESOURCE_HANDLER_MAP.put(new ResourceHandler.Key(handler.getKind().toLowerCase(Locale.ROOT), handler.getApiVersion()), handler); } private  Handlers(); }
Handlers { public static <T extends HasMetadata, V extends VisitableBuilder<T, V>> void register(ResourceHandler<T,V> handler) { RESOURCE_HANDLER_MAP.put(new ResourceHandler.Key(handler.getKind().toLowerCase(Locale.ROOT), handler.getApiVersion()), handler); } private  Handlers(); static void register(ResourceHandler<T,V> handler); static void unregister(ResourceHandler<T,V> handler); static ResourceHandler<T, V> get(String kind, String apiVersion); static ResourceHandler<T, V> get(String kind, String apiVersion, ClassLoader classLoader); static ResourceHandler<T, V> get(ResourceHandler.Key key); static ResourceHandler<T, V> get(ResourceHandler.Key key, ClassLoader classLoader); }
Handlers { public static <T extends HasMetadata, V extends VisitableBuilder<T, V>> void register(ResourceHandler<T,V> handler) { RESOURCE_HANDLER_MAP.put(new ResourceHandler.Key(handler.getKind().toLowerCase(Locale.ROOT), handler.getApiVersion()), handler); } private  Handlers(); static void register(ResourceHandler<T,V> handler); static void unregister(ResourceHandler<T,V> handler); static ResourceHandler<T, V> get(String kind, String apiVersion); static ResourceHandler<T, V> get(String kind, String apiVersion, ClassLoader classLoader); static ResourceHandler<T, V> get(ResourceHandler.Key key); static ResourceHandler<T, V> get(ResourceHandler.Key key, ClassLoader classLoader);  }