Package net.obvj.confectory.source
Class AbstractSource<T>
- java.lang.Object
-
- net.obvj.confectory.source.AbstractSource<T>
-
- Type Parameters:
T- the configuration data type returned by thisSource
- All Implemented Interfaces:
Source<T>
- Direct Known Subclasses:
DummySource,DynamicSource,FileSource,StringSource,URLSource
public abstract class AbstractSource<T> extends Object implements Source<T>
An abstract configuration source, with common infrastructure.- Since:
- 0.1.0
- Author:
- oswaldo.bapvic.jr (Oswaldo Junior)
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object other)Indicates whether some other object is "equal to" this one.inthashCode()Tload(Mapper<T> mapper, boolean optional)Applies a specific configuration loading strategy and returns a mapped bean containing the retrieved data.StringtoString()
-
-
-
Method Detail
-
load
public T load(Mapper<T> mapper, boolean optional)
Description copied from interface:SourceApplies a specific configuration loading strategy and returns a mapped bean containing the retrieved data. If theoptionalparameter istrueand the operation fails, this method returnsnull.- Specified by:
loadin interfaceSource<T>- Parameters:
mapper- theMapperto be applied on the source input streamoptional- a flag indicating whether or not an exception should be thrown in an event of failure to load the configuration source- Returns:
- the loaded configuration data, or
nullin an event of failure if theoptionalflag set astrue
-
equals
public boolean equals(Object other)
Indicates whether some other object is "equal to" this one.Two
Sourceobjects can be considered equal if both share the same implementation and parameter/path.
-
-