public class InternalWeakInternedCache<T> extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
InternalWeakInternedCache.EqualsExtractor<T>
Helper for extracting an object (from another object) that can be used for equals-checks.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> InternalWeakInternedCache<T> |
forIdentityEqualsObjects(InternalWeakInternedCache.EqualsExtractor<T> equalsExtractor)
Creates a new cache for objects that do use just identity check for their equals
implementation.
|
static <T> InternalWeakInternedCache<T> |
forNonIdentityEqualsObjects()
Creates a new cache for objects that do not use "identity-equals" that is to say, equals
implementation shall not be just == check on the object, but instead must work for multiple
"same" objects, and the cache ensures only a single one of them is returned, but multiple
instances that are the same can be given to the
intern(Object) method. |
T |
intern(T object)
Returns a "canonical" version of the object.
|
public static <T> InternalWeakInternedCache<T> forIdentityEqualsObjects(InternalWeakInternedCache.EqualsExtractor<T> equalsExtractor)
intern(Object) the given
equalsExtractor is used to extract an object (from the given one) that instead is used for the
equal check.public static <T> InternalWeakInternedCache<T> forNonIdentityEqualsObjects()
intern(Object) method.Copyright © 2026. All rights reserved.