Package net.apartium.cocoabeans.collect
Class Dummies
java.lang.Object
net.apartium.cocoabeans.collect.Dummies
A utility class providing "dummy" implementations of java collection api classes.
The provided objects are guaranteed to always remain empty. If a piece of code attempts to alter the state of the object, nothing will happen,
this is in contrast to java's own
Collections.emptyMap() or Collections.emptySet(), which will throw an exception when something attempts to modify it.
It is useful for shimming and rigging external code without causing too much trouble.-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Dummies
public Dummies()
-
-
Method Details
-
dummyMap
Returns the dummy map instance.- Type Parameters:
K- map key typeV- map value type- Returns:
- the dummy map instance.
-
dummySet
Returns the dummy set instance- Type Parameters:
E- element type- Returns:
- the dummy set instance
-
dummyList
Returns the dummy list instance- Type Parameters:
E- element type- Returns:
- the dummy list instance
-
dummyCollection
Returns the dummy collection instance- Type Parameters:
E- element type- Returns:
- the dummy collection instance
-