com.aliyun.openservices.shade.io.opentelemetry.api.internal.Utils Maven / Gradle / Ivy
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
package com.aliyun.openservices.shade.com.aliyun.openservices.shade.io.opentelemetry.api.internal;
import javax.annotation.concurrent.Immutable;
/**
* General internal utility methods.
*
* This class is internal and is hence not for public use. Its APIs are unstable and can change
* at any time.
*/
@Immutable
public final class Utils {
private Utils() {}
/**
* Throws an {@link IllegalArgumentException} if the argument is false. This method is similar to
* {@code Preconditions.checkArgument(boolean, Object)} from Guava.
*
* @param isValid whether the argument check passed.
* @param errorMessage the message to use for the exception.
*/
public static void checkArgument(boolean isValid, String errorMessage) {
if (!isValid) {
throw new IllegalArgumentException(errorMessage);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy