com.vladium.util
Class IProperties.Factory

java.lang.Object
  extended bycom.vladium.util.IProperties.Factory
Enclosing class:
IProperties

public abstract static class IProperties.Factory
extends java.lang.Object


Nested Class Summary
private static class IProperties.Factory.PropertiesImpl
           
 
Constructor Summary
IProperties.Factory()
           
 
Method Summary
static IProperties combine(IProperties overrides, IProperties base)
          Combines two property sets by creating a property set that chains 'overrides' to 'base' for property delegation.
static IProperties create(IProperties.IMapper mapper)
          Creates an empty IProperties set with an optional property mapper.
static IProperties wrap(java.util.Properties properties, IProperties.IMapper mapper)
          Converts a java.util.Properties instance to an IProperties instance, with an optional property mapper.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IProperties.Factory

public IProperties.Factory()
Method Detail

create

public static IProperties create(IProperties.IMapper mapper)
Creates an empty IProperties set with an optional property mapper.

Parameters:
mapper - [may be null]
Returns:
an empty property set [never null]

wrap

public static IProperties wrap(java.util.Properties properties,
                               IProperties.IMapper mapper)
Converts a java.util.Properties instance to an IProperties instance, with an optional property mapper. Note that 'properties' content is shallowly cloned, so the result can be mutated independently from the input.

Parameters:
properties - [may not be null]
mapper - [may be null]
Returns:
a property set based on 'properties' [never null]

combine

public static IProperties combine(IProperties overrides,
                                  IProperties base)
Combines two property sets by creating a property set that chains 'overrides' to 'base' for property delegation. Note that 'overrides' are cloned defensively and so the result can be mutated independently of both inputs.

Parameters:
overrides - [may be null]
base - [may be null]
Returns:
[never null; an empty property set with a null mapper is created if both inputs are null]