Jelajahi Sumber

use functional style

Armin Schrenk 2 tahun lalu
induk
melakukan
3cbe4aa7eb
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      src/main/java/org/cryptomator/ui/health/Result.java

+ 1 - 1
src/main/java/org/cryptomator/ui/health/Result.java

@@ -21,7 +21,7 @@ record Result(DiagnosticResult diagnosis, ObjectProperty<FixState> fixState) {
 	}
 
 	public static Result create(DiagnosticResult diagnosis, Path vaultPath, VaultConfig config, Masterkey masterkey, Cryptor cryptor) {
-		FixState initialState = diagnosis.getFix(vaultPath, config, masterkey, cryptor).isPresent()? FixState.FIXABLE : FixState.NOT_FIXABLE;
+		FixState initialState = diagnosis.getFix(vaultPath, config, masterkey, cryptor).map( _f -> FixState.FIXABLE).orElse(FixState.NOT_FIXABLE);
 		return new Result(diagnosis, new SimpleObjectProperty<>(initialState));
 	}