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

com.blade.mvc.http.ViewBody Maven / Gradle / Ivy

package com.blade.mvc.http;

import com.blade.mvc.ui.ModelAndView;
import io.netty.handler.codec.http.FullHttpResponse;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class ViewBody implements Body {

    private final ModelAndView modelAndView;

    public ViewBody(ModelAndView modelAndView) {
        this.modelAndView = modelAndView;
    }

    public static ViewBody of(ModelAndView modelAndView){
        return new ViewBody(modelAndView);
    }

    public ModelAndView modelAndView() {
        return modelAndView;
    }

    @Override
    public FullHttpResponse write(BodyWriter writer) {
        return writer.onView(this);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy