Class Normalizer<T>
java.lang.Object
org.microbean.attributes.Normalizer<T>
- Type Parameters:
T- the type of object to be normalized
A simple, mutable, concurrent,
Attributed-aware cache of objects.- Author:
- Laird Nelson
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal TNormalizes the suppliedelementsuch that if thisNormalizeralready has an equivalent cached element, the cached element is returned, and, if it does not, the suppliedelementis cached indefinitely and returned.
-
Constructor Details
-
Normalizer
public Normalizer()Creates a newNormalizer.
-
-
Method Details
-
normalize
Normalizes the suppliedelementsuch that if thisNormalizeralready has an equivalent cached element, the cached element is returned, and, if it does not, the suppliedelementis cached indefinitely and returned.Note: if the supplied
elementis anAttributedimplementation, then, in accordance with theAttributedcontract, it must not include its attributes in its equality or hashcode computations, or undefined behavior may result.- Parameters:
element- the element to normalize; may benullin which casenullis returned- Returns:
- the supplied
elementor a previously cached equivalent element
-