org.codegist.crest.config
Class ConfigBuilders
java.lang.Object
org.codegist.crest.config.ConfigBuilders
- Direct Known Subclasses:
- ConfigBuilders.InterfaceConfigBuilder, ConfigBuilders.MethodConfigBuilder, ConfigBuilders.ParamConfigBuilder
public abstract class ConfigBuilders
- extends Object
Handy builders for DefaultInterfaceConfig
.
Support auto empty/null ignore and defaults methods and params values at respectively interface and method levels.
Eg :
InterfaceConfig config = new ConfigBuilders.InterfaceConfigBuilder(MyInterface.class, "http://local")
.setMethodsConnectionTimeout(20) // overall connection timeout, method configs will inherit it if not set.
.setMethodsSocketTimeout(20) // overall socket timeout, method configs will inherit it if not set.
.setMethodsHttpMethod("PUT") // overall http method, method configs will inherit it if not set.
(...) more interface config
.startMethodConfig(MyInterface.class.getDeclaredMethod(....))
.setHttpMethod("POST") // Method config specific http method.
(...) more method config
.startParamConfig(0)
(...) more param config
.endParamConfig()
.endMethodConfig()
.build();
// Any non specified property will be defaulted to the respective default value taken from InterfaceConfig
,MethodConfig
,ParamConfig
- Author:
- Laurent Gilles (laurent.gilles@codegist.org)
- See Also:
DefaultInterfaceConfig
,
DefaultMethodConfig
,
DefaultParamConfig
Copyright © 2011. All Rights Reserved.