mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
Merge remote-tracking branch 'origin/GP-3979_ghidragon_program_caching--SQUASHED'
This commit is contained in:
@@ -42,6 +42,16 @@ public class Dummy {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a dummy consumer
|
||||
* @return a dummy consumer
|
||||
*/
|
||||
public static <T, U> BiConsumer<T, U> biConsumer() {
|
||||
return (t, u) -> {
|
||||
// no-op
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a dummy function
|
||||
* @param <T> the input type
|
||||
@@ -82,6 +92,17 @@ public class Dummy {
|
||||
return c == null ? consumer() : c;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the given consumer object if it is not {@code null}. Otherwise, a
|
||||
* {@link #biConsumer()} is returned. This is useful to avoid using {@code null}.
|
||||
*
|
||||
* @param c the consumer function to check for {@code null}
|
||||
* @return a non-null consumer
|
||||
*/
|
||||
public static <T, U> BiConsumer<T, U> ifNull(BiConsumer<T, U> c) {
|
||||
return c == null ? biConsumer() : c;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the given callback object if it is not {@code null}. Otherwise, a {@link #callback()}
|
||||
* is returned. This is useful to avoid using {@code null}.
|
||||
|
||||
Reference in New Issue
Block a user