2
0

Site settings & add sites.

This commit is contained in:
Maarten Billemont
2018-07-28 14:03:49 -04:00
parent e639137304
commit 46d301df94
26 changed files with 377 additions and 162 deletions

View File

@@ -6,7 +6,7 @@ description = 'Master Password Algorithm Implementation'
tasks.withType( JavaCompile ) {
// Native headers
options.compilerArgs += ["-h", new File( new File( project( ':masterpassword-core' ).projectDir, 'src' ), 'java' ).absolutePath]
options.compilerArgs += ["-h", new File( new File( project.project( ':masterpassword-core' ).projectDir, 'src' ), 'java' ).absolutePath]
}
configurations {

View File

@@ -2,6 +2,7 @@ package com.lyndir.masterpassword.util;
import java.util.function.Consumer;
import java.util.function.Function;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@@ -18,6 +19,14 @@ public final class Utilities {
return consumer.apply( value );
}
@Nonnull
public static <T, R> R ifNotNullElse(@Nullable final T value, final Function<T, R> consumer, @Nonnull final R nullValue) {
if (value == null)
return nullValue;
return consumer.apply( value );
}
public static <T> void ifNotNullDo(@Nullable final T value, final Consumer<T> consumer) {
if (value != null)
consumer.accept( value );