Class PropertyMap

  • All Implemented Interfaces:
    java.lang.Cloneable
    Direct Known Subclasses:
    ModelObjectMap

    public class PropertyMap
    extends Properties
    A Map backing of Properties.

    When this is cloned it will deep copy not only the model object map, but also each clonable member inside the map.

    Subclassing is supported, a hook can be implemented to provide conditional inclusion in the map. By default - all properties are accepted, so set is never propagated.

    This class is not multithread safe.

    Author:
    bratseth
    • Constructor Summary

      Constructors 
      Constructor Description
      PropertyMap()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      PropertyMap clone()  
      static java.lang.Object clone​(java.lang.Object object)
      Clones this object if it is clonable, and the clone is public.
      java.lang.Object get​(com.yahoo.processing.request.CompoundName name, java.util.Map<java.lang.String,​java.lang.String> context, com.yahoo.processing.request.Properties substitution)  
      java.util.Map<java.lang.String,​java.lang.Object> listProperties​(com.yahoo.processing.request.CompoundName path, java.util.Map<java.lang.String,​java.lang.String> context, com.yahoo.processing.request.Properties substitution)  
      java.util.Map<com.yahoo.processing.request.CompoundName,​java.lang.Object> propertyMap()
      Returns a direct reference to the map containing the properties set in this instance.
      void set​(com.yahoo.processing.request.CompoundName name, java.lang.Object value, java.util.Map<java.lang.String,​java.lang.String> context)  
      protected boolean shouldSet​(com.yahoo.processing.request.CompoundName name, java.lang.Object value)
      Return true if this value should be set in this map, false if the set should be propagated instead This default implementation always returns true.
      • Methods inherited from class com.yahoo.processing.request.Properties

        asBoolean, asDouble, asInteger, asLong, asString, chain, cloneMap, get, get, get, get, get, get, get, getBoolean, getBoolean, getBoolean, getBoolean, getDouble, getDouble, getDouble, getDouble, getInstance, getInteger, getInteger, getInteger, getInteger, getLong, getLong, getLong, getLong, getString, getString, getString, getString, listProperties, listProperties, listProperties, listProperties, listProperties, listProperties, listProperties, set, set, set
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PropertyMap

        public PropertyMap()
    • Method Detail

      • set

        public void set​(com.yahoo.processing.request.CompoundName name,
                        java.lang.Object value,
                        java.util.Map<java.lang.String,​java.lang.String> context)
        Overrides:
        set in class com.yahoo.processing.request.Properties
      • shouldSet

        protected boolean shouldSet​(com.yahoo.processing.request.CompoundName name,
                                    java.lang.Object value)
        Return true if this value should be set in this map, false if the set should be propagated instead This default implementation always returns true.
      • get

        public java.lang.Object get​(com.yahoo.processing.request.CompoundName name,
                                    java.util.Map<java.lang.String,​java.lang.String> context,
                                    com.yahoo.processing.request.Properties substitution)
        Overrides:
        get in class com.yahoo.processing.request.Properties
      • propertyMap

        public java.util.Map<com.yahoo.processing.request.CompoundName,​java.lang.Object> propertyMap()
        Returns a direct reference to the map containing the properties set in this instance.
      • listProperties

        public java.util.Map<java.lang.String,​java.lang.Object> listProperties​(com.yahoo.processing.request.CompoundName path,
                                                                                     java.util.Map<java.lang.String,​java.lang.String> context,
                                                                                     com.yahoo.processing.request.Properties substitution)
        Overrides:
        listProperties in class com.yahoo.processing.request.Properties
      • clone

        public static java.lang.Object clone​(java.lang.Object object)
        Clones this object if it is clonable, and the clone is public. Returns null if not