Interface Interner<E>


  • @Beta
    @Deprecated(since="2022-12-01")
    public interface Interner<E>
    Deprecated.
    The Google Guava Core Libraries are deprecated and will not be part of the AEM SDK after April 2023
    Provides equivalent behavior to String.intern() for other immutable types.
    Since:
    3.0
    • Method Detail

      • intern

        E intern​(E sample)
        Deprecated.
        Chooses and returns the representative instance for any of a collection of instances that are equal to each other. If two equal inputs are given to this method, both calls will return the same instance. That is, intern(a).equals(a) always holds, and intern(a) == intern(b) if and only if a.equals(b). Note that intern(a) is permitted to return one instance now and a different instance later if the original interned instance was garbage-collected.

        Warning: do not use with mutable objects.

        Throws:
        java.lang.NullPointerException - if sample is null