All Downloads are FREE. Search and download functionalities are using the official Maven repository.

it.auties.protobuf.parser.exception.ProtobufSyntaxException Maven / Gradle / Ivy

There is a newer version: 3.4.0
Show newest version
package it.auties.protobuf.parser.exception;

public class ProtobufSyntaxException extends IllegalArgumentException {
    public ProtobufSyntaxException(String message, int line, Object... args) {
        super("%s at line %s".formatted(formatMessage(message, args), line));
    }

    private static String formatMessage(String message, Object[] args) {
        return message == null ? null : message.formatted(args);
    }

    public static void check(boolean condition, String message, int line, Object... args) {
        if (condition) {
            return;
        }

        throw new ProtobufSyntaxException(message, line, args);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy