Class SimpleValueFetcher

  • All Implemented Interfaces:
    IValueFetcher

    public class SimpleValueFetcher
    extends java.lang.Object
    implements IValueFetcher
    Simple default implementation of a value fetcher useful for basic usage scenarios or as a base for extending.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected IValueFetcher parent
      The parent fetcher if any.
      protected java.util.Map values
      The values.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object fetchValue​(java.lang.String name)
      Fetch a value via its name.
      void setValue​(java.lang.String key, java.lang.Object value)
      Set a value.
      void setValues​(java.util.Map<java.lang.String,​java.lang.Object> values)
      Set values.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • values

        protected java.util.Map values
        The values.
      • parent

        protected IValueFetcher parent
        The parent fetcher if any.
    • Constructor Detail

      • SimpleValueFetcher

        public SimpleValueFetcher()
        Create a new fetcher.
      • SimpleValueFetcher

        public SimpleValueFetcher​(IValueFetcher parent)
        Create a new fetcher.
    • Method Detail

      • fetchValue

        public java.lang.Object fetchValue​(java.lang.String name)
        Fetch a value via its name.
        Specified by:
        fetchValue in interface IValueFetcher
        Parameters:
        name - The name.
        Returns:
        The value.
      • setValue

        public void setValue​(java.lang.String key,
                             java.lang.Object value)
        Set a value.
        Parameters:
        key - The key.
        value - The value.
      • setValues

        public void setValues​(java.util.Map<java.lang.String,​java.lang.Object> values)
        Set values.
        Parameters:
        values - The values map.