I have read a lot about final
and when to use it or not ,and I have come to the conclusion that it's mostly personal design. So, consider this class below, is this a case where I'm overusing final or not? I know that I should write readable and clear code ,and I think this still is pretty clear consider all the final.
public final class ConsoleUtil {
private static final Logger LOGGER = Bukkit.getLogger();
private ConsoleUtil() {
}
public static void info(final Object... objects) {
log(Level.INFO, objects);
}
public static void warning(final Object... objects) {
log(Level.WARNING, objects);
}
public static void severe(final Object... objects) {
log(Level.SEVERE, objects);
}
public static void exception(final Exception e, final Object... objects) {
warning(objects);
e.printStackTrace();
}
private static void log(final Level level, final Object... objects) {
for (Object object : objects) {
LOGGER.log(level, "[HubControl] " + object.toString());
}
}
}