Class SubKeyMap<V>

  • All Implemented Interfaces:
    Map<String,​V>

    public final class SubKeyMap<V>
    extends AbstractMap<String,​V>
    Map that wraps another to provide an isolated namespace using a prefix. This is especially handy for storing properties on the session in a structured manner without putting them into a true "Map" - because storing in a Map breaks session failover. (Session failover won't trigger on mutations of contained objects.)

    Note that there is a potential design flaw; if you create a SubKeyMap for "mypackage.foo" and for "mypackage.foo.bar", all the keys in the latter will actually show up in the former (prefixed by ".bar"). This "flaw" is actually relied on by PageFlowScopeMap (since it provides a handy way to clear out all descendents), so don't "fix" it!