/** * A method to get a required configuration of a particular type. * * @param name The name of the required configuration. * @param clazz The class of the required configuration. * @param <T> The type to cast the configuration to. Inferred from clazz. * @return The extracted configuration of type T. * @throws PubSubException if the configuration is missing or cannot be cast to type T. */ public <T> T getRequiredConfig(Class<T> clazz, String name) throws PubSubException { try { return config.getRequiredConfigAs(name, clazz); } catch (Exception e) { throw PubSubException.forArgument(name, e); } } }