Skip to content

Commit

Permalink
inheritance fixes for plugin files
Browse files Browse the repository at this point in the history
  • Loading branch information
burdoto committed Aug 18, 2024
1 parent 007cdef commit 9785c69
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/org/comroid/api/func/util/Almost.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,11 @@ public T get() {
public T complete(@Nullable Consumer<B> modifier) {return complete(modifier, null);}

@NotNull
public abstract T complete(@Nullable Consumer<B> modifier, @Nullable Consumer<T> finalizer);
public T complete(@Nullable Consumer<B> modifier, @Nullable Consumer<T> finalizer) {
var value = complete(modifier);
if (finalizer != null)
// todo on GetOrCreate, should be done before saving etc
finalizer.accept(value);
return value;
}
}

0 comments on commit 9785c69

Please sign in to comment.