Skip to content

Commit

Permalink
[Inference API] Make ServiceUtils final and add private constructor (e…
Browse files Browse the repository at this point in the history
  • Loading branch information
timgrein authored Jun 6, 2024
1 parent aec0797 commit 8619713
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import static org.elasticsearch.core.Strings.format;
import static org.elasticsearch.xpack.inference.services.ServiceFields.SIMILARITY;

public class ServiceUtils {
public final class ServiceUtils {
/**
* Remove the object from the map and cast to the expected type.
* If the object cannot be cast to type an ElasticsearchStatusException
Expand Down Expand Up @@ -624,4 +624,6 @@ public static SecureString apiKey(@Nullable ApiKeySecrets secrets) {
// To avoid a possible null pointer throughout the code we'll create a noop api key of an empty array
return secrets == null ? new SecureString(new char[0]) : secrets.apiKey();
}

private ServiceUtils() {}
}

0 comments on commit 8619713

Please sign in to comment.