mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 02:09:44 +02:00
GP-3970 program caching and refactoring of ProgramManager and OpenProgramTask
This commit is contained in:
parent
5d487a6518
commit
7d67188d0b
34 changed files with 2198 additions and 948 deletions
|
@ -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}.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue