Class InternalUtils

java.lang.Object
org.bitcoinj.base.internal.InternalUtils

public class InternalUtils extends Object
Utilities for internal use only.
  • Field Details

  • Constructor Details

    • InternalUtils

      public InternalUtils()
  • Method Details

    • joiner

      public static InternalUtils.Joiner joiner(String delimiter)
      Return a lambda for joining Strings or Objects via Object.toString().
      Parameters:
      delimiter - The delimiter used to join the String components
      Returns:
      A Joiner (lambda) instance
    • splitter

      public static InternalUtils.Splitter splitter(String regex)
      Return a lambda for splitting a string into components
      Parameters:
      regex - regular expression used to split components
      Returns:
      A Splitter (lambda) instance
    • commaJoin

      public static String commaJoin(String... strings)
      Join strings with ", " skipping nulls
      Parameters:
      strings - varargs strings
      Returns:
      A joined string
    • getUninterruptibly

      public static <V> V getUninterruptibly(Future<V> future) throws ExecutionException
      Get a future's value uninterruptibly by temporarily ignoring InterruptedException, but making sure we re-set the thread's interrupt status, so higher-level code on the thread can handle the interruption properly. Based upon the Guava implementation.
      Type Parameters:
      V - type of value
      Parameters:
      future - future with value to get
      Returns:
      the value
      Throws:
      ExecutionException - if the computation through an exception