Class ModelsImpl

java.lang.Object
fr.paris.lutece.portal.web.cdi.mvc.ModelsImpl
All Implemented Interfaces:
Models, Iterable<String>

@RequestScoped public class ModelsImpl extends Object implements Models
Implementation of Models interface. A CDI class that delegates to a Map implementation.
  • Constructor Details

    • ModelsImpl

      public ModelsImpl()
  • Method Details

    • put

      public Models put(String name, Object model)
      Description copied from interface: Models
      Stores a new model in the map.
      Specified by:
      put in interface Models
      Parameters:
      name - name of the model
      model - model to store in the map
      Returns:
      the current instance to allow method chaining
    • get

      public Object get(String name)
      Description copied from interface: Models
      Retrieve a model by name.
      Specified by:
      get in interface Models
      Parameters:
      name - name of the model
      Returns:
      the model or null
    • get

      public <T> T get(String name, Class<T> type)
      Description copied from interface: Models
      Retrieve a model by name in a type-safe way.
      Specified by:
      get in interface Models
      Type Parameters:
      T - type of the model
      Parameters:
      name - name of the model
      type - type of the model
      Returns:
      The model or null
    • asMap

      public Map<String,Object> asMap()
      Description copied from interface: Models
      Returns a unmodifiable view of the models map.
      Specified by:
      asMap in interface Models
      Returns:
      unmodifiable map
    • iterator

      public Iterator<String> iterator()
      Specified by:
      iterator in interface Iterable<String>