diff --git a/src/main/java/com/meilisearch/sdk/Client.java b/src/main/java/com/meilisearch/sdk/Client.java index 37e250eb..2613dc52 100644 --- a/src/main/java/com/meilisearch/sdk/Client.java +++ b/src/main/java/com/meilisearch/sdk/Client.java @@ -258,7 +258,7 @@ public String health() throws MeilisearchException { * @see API * specification */ - public Boolean isHealthy() throws MeilisearchException { + public boolean isHealthy() throws MeilisearchException { return this.instanceHandler.isHealthy(); } @@ -510,7 +510,7 @@ public String generateTenantToken( Date now = new Date(); String secret; - if (options.getApiKey() == null || options.getApiKey() == "") { + if (options.getApiKey() == null || options.getApiKey().isEmpty()) { secret = this.config.apiKey; } else { secret = options.getApiKey(); @@ -519,7 +519,7 @@ public String generateTenantToken( if (options.getExpiresAt() != null && now.after((Date) options.getExpiresAt())) { throw new MeilisearchException("The date expiresAt should be in the future."); } - if (secret == null || secret == "" || secret.length() <= 8) { + if (secret == null || secret.length() <= 8) { throw new MeilisearchException( "An api key is required in the client or should be passed as an argument and this key cannot be the master key."); } @@ -527,7 +527,7 @@ public String generateTenantToken( throw new MeilisearchException( "The searchRules field is mandatory and should be defined."); } - if (apiKeyUid == "" || apiKeyUid == null || !isValidUUID(apiKeyUid)) { + if (apiKeyUid == null || apiKeyUid.isEmpty() || !isValidUUID(apiKeyUid)) { throw new MeilisearchException( "The uid used for the token generation must exist and comply to uuid4 format"); } @@ -604,7 +604,7 @@ public void deleteWebhook(UUID webhookUuid) throws MeilisearchException { this.webHooksHandler.deleteWebhook(webhookUuid); } - private Boolean isValidUUID(String apiKeyUid) { + private boolean isValidUUID(String apiKeyUid) { try { UUID uuid = UUID.fromString(apiKeyUid); } catch (IllegalArgumentException exception) {