Skip to content

Commit 0d785be

Browse files
committed
feat: simplicy optional expression
Signed-off-by: Otavio Santana <[email protected]>
1 parent 0799a03 commit 0d785be

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jnosql-mongodb/src/main/java/org/eclipse/jnosql/databases/mongodb/communication/MongoAuthentication.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ static Optional<MongoCredential> of(Settings settings) {
4747
.map(Object::toString)
4848
.map(AuthenticationMechanism::fromMechanismName);
4949

50-
if (!user.isPresent()) {
50+
if (user.isEmpty()) {
5151
return Optional.empty();
5252
}
5353

54-
if (!mechanism.isPresent()) {
54+
if (mechanism.isEmpty()) {
5555
return Optional.of(MongoCredential.createCredential(user.orElseThrow(missingExceptionUser()),
5656
source.orElseThrow(missingExceptionSource()), password.orElseThrow(missingExceptionPassword())));
5757
}

0 commit comments

Comments
 (0)