private static final String EMPTY = "";
/**
- * Gets property value.
+ * Gets string property value.
*
* @param key Property key.
* @return Property value (possibly empty string, but never {@code null}).
}
/**
+ * Gets boolean property value.
+ *
+ * @param key Property key.
+ * @return Property value ({@code false} by default).
+ */
+ public static boolean is(String key) {
+ return Boolean.parseBoolean(
+ PROPERTIES.getProperty(key, Boolean.FALSE.toString())
+ );
+ }
+
+ /**
+ * Zero integer for not found properties.
+ */
+ private static final String ZERO = "0";
+
+ /**
+ * Gets integer property value.
+ *
+ * @param key Property key.
+ * @return Property value ({@code 0} by default).
+ */
+ public static int getInt(String key) {
+ return Integer.parseInt(
+ PROPERTIES.getProperty(key, ZERO)
+ );
+ }
+
+ /**
* Private constructor.
*/
private ChessHogScannerProperties() {