All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.rahulsom.rpconfig.ConfigHandler Maven / Gradle / Ivy

package com.github.rahulsom.rpconfig;

import ratpack.handling.Context;
import ratpack.handling.Handler;
import ratpack.jackson.Jackson;

/**
 * Renders Configuration as JSON
 */
@SuppressWarnings("WeakerAccess")
public class ConfigHandler implements Handler {

    private T configObject;

    ConfigHandler(T configObject) {
        this.configObject = configObject;
    }

    @Override
    public void handle(Context ctx) throws Exception {
        ctx.render(Jackson.json(configObject));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy