protected ControllerProxy<?, ?> getController(ModelMetadata model) throws IncompatibleControllerException { Class<?> keyType = model.getKeyField().getType(); Class<?> modelType = model.getType(); ControllerProxy<?, ?> crud = getControllerProxy(keyType, modelType); if (crud == null) crud = getDynamicController(keyType, modelType, model); return crud; }
private F.Option<? extends ControllerProxy<?, ?>> getController(ModelMetadata model) throws IncompatibleControllerException { ControllerProxy<?, ?> crud = controllerRegistry.getController(model.getKeyField().getType(), model.getType()); return crud == null ? F.Option.<ControllerProxy<?, ?>>None() : F.Option.Some(crud); }