public class L extends Object
| Constructor and Description |
|---|
L() |
| Modifier and Type | Method and Description |
|---|---|
static void |
async(Runnable r)
Run asynchronously on another thread; the thread has started
when this function returns.
|
static String |
byteBufferToString(ByteBuffer bb)
ByteBuffer to String
|
static <V> V |
callWithAfter(Supplier<V> action,
Runnable after)
Execute and return a value; always call the "after" runnable
|
static <V> V |
callWithBeforeAfter(Supplier<V> action,
Runnable before,
Runnable after)
Execute.
|
static <V> V |
callWithLock(Lock lock,
Supplier<V> r)
Run inside a Lock
|
static ByteBuffer |
stringToByteBuffer(String str)
String to ByteBuffer as UTF-8 bytes
|
static <T> T |
syncCallThread(Supplier<T> r)
Run synchronously but on another thread.
|
static void |
syncOtherThread(Runnable r)
Run synchronously but on another thread.
|
static byte[] |
uuidAsBytes(JenaUUID uuid)
Jena UUID to bytes (most significant first)
|
static byte[] |
uuidAsBytes(long mostSignificantBits,
long leastSignificantBits)
UUID, as two longs, as bytes
|
static byte[] |
uuidAsBytes(String str)
A UUID string to bytes
|
static byte[] |
uuidAsBytes(UUID uuid)
Java UUID to bytes (most significant first)
|
static String |
uuidToString(long mostSignificantBits,
long leastSignificantBits) |
static void |
withAfter(Runnable action,
Runnable after)
Execute; always call the "after" runnable
|
static void |
withBeforeAfter(Runnable action,
Runnable before,
Runnable after)
Execute.
|
static void |
withLock(Lock lock,
Runnable r)
Run inside a Lock
|
static void |
writeStringAsUTF8(OutputStream out,
String content)
Write a string into an
OutputStream as UTF-8. |
static void |
writeStringAsUTF8(String filename,
String content)
Write a string to a file as UTF-8.
|
public static byte[] uuidAsBytes(UUID uuid)
public static byte[] uuidAsBytes(JenaUUID uuid)
public static byte[] uuidAsBytes(long mostSignificantBits,
long leastSignificantBits)
public static byte[] uuidAsBytes(String str)
public static String uuidToString(long mostSignificantBits, long leastSignificantBits)
public static void async(Runnable r)
public static void syncOtherThread(Runnable r)
public static <T> T syncCallThread(Supplier<T> r)
public static void withBeforeAfter(Runnable action, Runnable before, Runnable after)
action - before - after - public static <V> V callWithBeforeAfter(Supplier<V> action, Runnable before, Runnable after)
action - before - after - public static void withAfter(Runnable action, Runnable after)
public static <V> V callWithAfter(Supplier<V> action, Runnable after)
public static void writeStringAsUTF8(String filename, String content) throws IOException
filename - content - String to be writtenIOExceptionpublic static void writeStringAsUTF8(OutputStream out, String content) throws IOException
OutputStream as UTF-8.out - OutputStream destination.content - String to be writtenIOExceptionpublic static ByteBuffer stringToByteBuffer(String str)
public static String byteBufferToString(ByteBuffer bb)
Licensed under the Apache License, Version 2.0