org.codegist.crest.config
Class Configs

java.lang.Object
  extended by org.codegist.crest.config.Configs

public final class Configs
extends Object

Author:
Laurent Gilles (laurent.gilles@codegist.org)

Method Summary
static InterfaceConfig override(InterfaceConfig base, InterfaceConfig overrides)
          Overrides and config (overrides) with another one (base).
static MethodConfig override(MethodConfig base, MethodConfig overrides)
          Overrides and config (overrides) with another one (base).
static ParamConfig override(ParamConfig base, ParamConfig overrides)
          Overrides and config (overrides) with another one (base).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

override

public static InterfaceConfig override(InterfaceConfig base,
                                       InterfaceConfig overrides)
Overrides and config (overrides) with another one (base).

The override is a config template where nulls values are legals and will fallback to the base config. Base config must apply to the general contract of InterfaceConfig.

Any non-null values in override config will take priority over base config.

RequestInterceptor are not overriding each other but are chaining, thus if either override and base configs declare a request interceptor, both of them will run, with the override's request interceptor running before the base one.

The returned config is a dynamic view over the two given config, thus the two configs can change over time and the resulting config will reflect the changes.

Parameters:
base - Normal full configured config, respect the general contract of InterfaceConfig object
overrides - Config template, can hold null values, that plays as flag to indicate a fallback to the base config
Returns:
A view that gives priority of "overrides" non-null values object upon "base" object. Any changes at runtime will be reflected.
See Also:
InterfaceConfig

override

public static MethodConfig override(MethodConfig base,
                                    MethodConfig overrides)
Overrides and config (overrides) with another one (base).

The override is a config template where nulls values are legals and will fallback to the base config. Base config must apply to the general contract of MethodConfig.

Any non-null values in override config will take priority over base config.

RequestInterceptor are not overriding each other but are chaining, thus if either override and base configs declare a request interceptor, both of them will run, with the override's request interceptor running before the base one.

The returned config is a dynamic view over the two given config, thus the two configs can change over time and the resulting config will reflect the changes.

Parameters:
base - Normal full configured config, respect the general contract of MethodConfig object
overrides - Config template, can hold null values, that plays as flag to indicate a fallback to the base config
Returns:
A view that gives priority of "overrides" non-null values object upon "base" object. Any changes at runtime will be reflected.
See Also:
MethodConfig

override

public static ParamConfig override(ParamConfig base,
                                   ParamConfig overrides)
Overrides and config (overrides) with another one (base).

The override is a config template where nulls values are legals and will fallback to the base config. Base config must apply to the general contract of ParamConfig.

Any non-null values in override config will take priority over base config.

The returned config is a dynamic view over the two given config, thus the two configs can change over time and the resulting config will reflect the changes.

Parameters:
base - Normal full configured config, respect the general contract of ParamConfig object
overrides - Config template, can hold null values, that plays as flag to indicate a fallback to the base config
Returns:
A view that gives priority of "overrides" non-null values object upon "base" object. Any changes at runtime will be reflected.
See Also:
ParamConfig


Copyright © 2011. All Rights Reserved.