Class NoCachingNoUpdating.DisposablePair<L,R>

java.lang.Object
com.landawn.abacus.util.NoCachingNoUpdating.DisposablePair<L,R>
Type Parameters:
L -
R -
All Implemented Interfaces:
NoCachingNoUpdating
Enclosing interface:
NoCachingNoUpdating

@Beta @SequentialOnly @Stateful public abstract static class NoCachingNoUpdating.DisposablePair<L,R> extends Object implements NoCachingNoUpdating
One-off Object. No caching/saving in memory, No updating. To cache/save/update the Object, call clone()/copy().
Depends on context, it should be okay to cache/save the elements from the array, but never save or cache the Pair itself.
  • Constructor Details

    • DisposablePair

      public DisposablePair()
  • Method Details

    • wrap

      public static <L, R> NoCachingNoUpdating.DisposablePair<L,R> wrap(Pair<L,R> p)
      Type Parameters:
      L -
      R -
      Parameters:
      p -
      Returns:
    • left

      public abstract L left()
      Returns:
    • right

      public abstract R right()
      Returns:
    • copy

      public Pair<L,R> copy()
      Returns:
    • apply

      public <U, E extends Exception> U apply(Throwables.BiFunction<? super L,? super R,? extends U,E> func) throws E
      Type Parameters:
      U -
      E -
      Parameters:
      func -
      Returns:
      Throws:
      E
    • accept

      public <E extends Exception> void accept(Throwables.BiConsumer<? super L,? super R,E> action) throws E
      Type Parameters:
      E -
      Parameters:
      action -
      Throws:
      E
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns: