Package com.firebase.ui.auth.util
Class Preconditions
- java.lang.Object
-
- com.firebase.ui.auth.util.Preconditions
-
public final class Preconditions extends java.lang.ObjectPrecondition checking utility methods.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcheckArgument(boolean expression, java.lang.String errorMessage)Ensures the truth of an expression involving parameters to the calling method.static voidcheckConfigured(android.content.Context context, java.lang.String message, int... ids)static <T> TcheckNotNull(T val, java.lang.String errorMessageTemplate, java.lang.Object... errorMessageArgs)Ensures that the provided value is not null, and throws aNullPointerExceptionif it is null, with a message constructed from the provided error template and arguments.static voidcheckUnset(android.os.Bundle b, java.lang.String message, java.lang.String... keys)static intcheckValidStyle(android.content.Context context, int styleId, java.lang.String errorMessageTemplate, java.lang.Object... errorMessageArguments)Ensures that the provided identifier matches a known style resource, and throws anIllegalArgumentExceptionif the resource cannot be found, or is not a style resource, with a message constructed from the provided error template and arguments.
-
-
-
Method Detail
-
checkNotNull
@NonNull public static <T> T checkNotNull(@Nullable T val, @NonNull java.lang.String errorMessageTemplate, @Nullable java.lang.Object... errorMessageArgs)Ensures that the provided value is not null, and throws aNullPointerExceptionif it is null, with a message constructed from the provided error template and arguments.
-
checkValidStyle
@StyleRes public static int checkValidStyle(@NonNull android.content.Context context, int styleId, @NonNull java.lang.String errorMessageTemplate, @Nullable java.lang.Object... errorMessageArguments)Ensures that the provided identifier matches a known style resource, and throws anIllegalArgumentExceptionif the resource cannot be found, or is not a style resource, with a message constructed from the provided error template and arguments.
-
checkUnset
public static void checkUnset(@NonNull android.os.Bundle b, @Nullable java.lang.String message, @NonNull java.lang.String... keys)
-
checkConfigured
public static void checkConfigured(@NonNull android.content.Context context, @Nullable java.lang.String message, @StringRes int... ids)
-
checkArgument
public static void checkArgument(boolean expression, java.lang.String errorMessage)Ensures the truth of an expression involving parameters to the calling method.- Parameters:
expression- a boolean expressionerrorMessage- the exception message to use if the check fails- Throws:
java.lang.IllegalArgumentException- ifexpressionis false
-
-