Class Interners.InternerFunction<E>

  • All Implemented Interfaces:
    Function<E,​E>
    Enclosing class:
    Interners

    private static class Interners.InternerFunction<E>
    extends java.lang.Object
    implements Function<E,​E>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Interner<E> interner  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      E apply​(E input)
      Returns the result of applying this function to input.
      boolean equals​(java.lang.Object other)
      May return true if is a Function that behaves identically to this function.
      int hashCode()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • interner

        private final Interner<E> interner
    • Constructor Detail

      • InternerFunction

        public InternerFunction​(Interner<E> interner)
    • Method Detail

      • apply

        public E apply​(E input)
        Description copied from interface: Function
        Returns the result of applying this function to input. This method is generally expected, but not absolutely required, to have the following properties:
        • Its execution does not cause any observable side effects.
        • The computation is consistent with equals; that is, Objects.equal(a, b) implies that Objects.equal(function.apply(a), function.apply(b)).
        Specified by:
        apply in interface Function<E,​E>
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object other)
        Description copied from interface: Function
        May return true if is a Function that behaves identically to this function.

        Warning: do not depend on the behavior of this method.

        Historically, Function instances in this library have implemented this method to recognize certain cases where distinct Function instances would in fact behave identically. However, as code migrates to java.util.function, that behavior will disappear. It is best not to depend on it.

        Specified by:
        equals in interface Function<E,​E>
        Overrides:
        equals in class java.lang.Object