Package org.bitcoinj.base.internal
Class InternalUtils
java.lang.Object
org.bitcoinj.base.internal.InternalUtils
Utilities for internal use only.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
A functional interface for joiningString
s orObject
s viaObject.toString()
using a pre-configured delimiter.static interface
A functional interface for splittingString
s using a pre-configured regular expression. -
Field Summary
Modifier and TypeFieldDescriptionstatic final InternalUtils.Joiner
AInternalUtils.Joiner
for joining strings into a single string delimited by a space character.static final InternalUtils.Splitter
AInternalUtils.Splitter
for splitting a string into components by whitespace. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
Join strings with ", " skipping nullsstatic <V> V
getUninterruptibly
(Future<V> future) Get a future's valueuninterruptibly
by temporarily ignoringInterruptedException
, but making sure we re-set the thread's interrupt status, so higher-level code on the thread can handle the interruption properly.static InternalUtils.Joiner
static InternalUtils.Splitter
Return a lambda for splitting a string into components
-
Field Details
-
SPACE_JOINER
AInternalUtils.Joiner
for joining strings into a single string delimited by a space character. -
WHITESPACE_SPLITTER
AInternalUtils.Splitter
for splitting a string into components by whitespace.
-
-
Constructor Details
-
InternalUtils
public InternalUtils()
-
-
Method Details
-
joiner
- Parameters:
delimiter
- The delimiter used to join theString
components- Returns:
- A
Joiner
(lambda) instance
-
splitter
Return a lambda for splitting a string into components- Parameters:
regex
- regular expression used to split components- Returns:
- A
Splitter
(lambda) instance
-
commaJoin
Join strings with ", " skipping nulls- Parameters:
strings
- varargs strings- Returns:
- A joined string
-
getUninterruptibly
Get a future's valueuninterruptibly
by temporarily ignoringInterruptedException
, 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
-