Class ModelAndView<T>

java.lang.Object
io.micronaut.views.ModelAndView<T>
Type Parameters:
T - The model type

public class ModelAndView<T> extends Object
Holder for both Model and View.
Since:
1.0
Author:
Sergio del Amo, graemerocher
  • Constructor Details

    • ModelAndView

      public ModelAndView()
      Empty constructor.
    • ModelAndView

      public ModelAndView(String view, T model)
      Constructor.
      Parameters:
      view - view name to be rendered
      model - Model to be rendered against the view
  • Method Details

    • getView

      public Optional<String> getView()
      Returns:
      view name to be rendered
    • setView

      public void setView(String view)
      Sets the view to use.
      Parameters:
      view - the view name
    • getModel

      public Optional<T> getModel()
      Returns:
      model to render
    • setModel

      public void setModel(T model)
      Sets the model to use.
      Parameters:
      model - model to be rendered