![JAR search and dependency download from the Maven repository](/logo.png)
me.deecaad.core.file.SerializerRangeException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mechanicscore Show documentation
Show all versions of mechanicscore Show documentation
Library plugin for WeaponMechanics containing Brigadier Commands, Mechanics, and more
package me.deecaad.core.file;
import org.jetbrains.annotations.NotNull;
public class SerializerRangeException extends SerializerException {
public SerializerRangeException(@NotNull String name, int min, int actual, int max, @NotNull String location) {
super(name, getMessages(min, actual, max), location);
}
public SerializerRangeException(@NotNull Serializer> serializer, int min, int actual, int max, @NotNull String location) {
super(serializer, getMessages(min, actual, max), location);
}
public SerializerRangeException(@NotNull String name, double min, double actual, double max, @NotNull String location) {
super(name, getMessages(min, actual, max), location);
}
public SerializerRangeException(@NotNull Serializer> serializer, double min, double actual, double max, @NotNull String location) {
super(serializer, getMessages(min, actual, max), location);
}
private static String[] getMessages(int min, int actual, int max) {
return new String[]{
"Given integer needs to be between " + min + " and " + max,
forValue(actual)
};
}
private static String[] getMessages(double min, double actual, double max) {
return new String[]{
"Given integer needs to be between " + min + " and " + max,
forValue(actual)
};
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy