/** * Check if a string is integer or long * * @param s the string * @return {@code true} if the string is integer or long * @see N#isInt(String) */ public static boolean isInt(String s) { return N.isInt(s); }
/** * Check if a string `s` represent an int or long * @param s the string * @return `true` if s represents an int or `false` otherwise */ public static boolean isInt(String s) { return isInt(s, 10); }
/** * Check if a string is integer or long * * @param s the string * @return {@code true} if the string is integer or long * @see N#isInt(String) */ public static boolean isInt(String s) { return N.isInt(s); }
/** * Check if a string `s` represent an int or long * @param s the string * @return `true` if s represents an int or `false` otherwise */ public static boolean isInt(String s) { return isInt(s, 10); }
public boolean integer() { return N.isInt(s); } public boolean wrappedWith(String left, String right) {
/** * Check if a string is integer or long * * @param s the string * @return {@code true} if the string is integer or long * @see N#isInt(String) */ public static boolean isIntOrLong(String s) { return N.isInt(s); }
/** * Check if a string is integer or long * * @param s the string * @return {@code true} if the string is integer or long * @see N#isInt(String) */ public static boolean isIntOrLong(String s) { return N.isInt(s); }
public boolean integer() { return N.isInt(s); } public boolean wrappedWith(String left, String right) {
/** * Check if a String `s` is numeric string * @param s the string * @return `true` if `s` is numeric or `false` otherwise */ public static boolean isNumeric(String s) { if (S.isBlank(s)) { return false; } if (isInt(s)) { return true; } try { Double.parseDouble(s); return true; } catch (Exception e) { return false; } }
/** * Check if a String `s` is numeric string * @param s the string * @return `true` if `s` is numeric or `false` otherwise */ public static boolean isNumeric(String s) { if (S.isBlank(s)) { return false; } if (isInt(s)) { return true; } try { Double.parseDouble(s); return true; } catch (Exception e) { return false; } }
@Override public Integer convert(String s) { if (S.isEmpty(s)) { return null; } if (N.isInt(s)) { return Integer.valueOf(s); } // try parse 10 * 60 style if (s.contains("*")) { List<String> factors = S.fastSplit(s, "*"); int result = 1; for (String factor: factors) { int l = Integer.parseInt(factor.trim()); result = result * l; } return result; } throw new NumberFormatException(s); }
@Override public Integer convert(String s) { if (S.isEmpty(s)) { return null; } if (N.isInt(s)) { return Integer.valueOf(s); } // try parse 10 * 60 style if (s.contains("*")) { List<String> factors = S.fastSplit(s, "*"); int result = 1; for (String factor: factors) { int l = Integer.parseInt(factor.trim()); result = result * l; } return result; } throw new NumberFormatException(s); }
@Override public Long convert(String s) { if (S.isEmpty(s)) { return null; } if (N.isInt(s)) { return Long.valueOf(s); } // try parse 10 * 60 style if (s.contains("*")) { List<String> factors = S.fastSplit(s, "*"); long result = 1; for (String factor: factors) { long l = Long.parseLong(factor.trim()); result = result * l; } return result; } throw new NumberFormatException(s); } };
@Override public Long convert(String s) { if (S.isEmpty(s)) { return null; } if (N.isInt(s)) { return Long.valueOf(s); } // try parse 10 * 60 style if (s.contains("*")) { List<String> factors = S.fastSplit(s, "*"); long result = 1; for (String factor: factors) { long l = Long.parseLong(factor.trim()); result = result * l; } return result; } throw new NumberFormatException(s); } };
public int secretRotatePeriod() { if (null == secretRotatePeriod) { boolean validSetting = true; String s = get(SECRET_ROTATE_PERIOD, "30"); int minutes; if (!N.isInt(s)) { int seconds = Time.parseDuration(s); int reminder = seconds % 60; if (0 != reminder) { validSetting = false; seconds += (60 - reminder); } minutes = seconds / 60; } else { minutes = Integer.parseInt(s); } if (minutes <= 0) { validSetting = false; minutes = 30; } secretRotatePeriod = RotationSecretProvider.roundToPeriod(minutes); validSetting = validSetting && (secretRotatePeriod == minutes); if (!validSetting) { warn("invalid secret.rotate.period setting found: %s, system automatically set it to: %s", s, secretRotatePeriod); } } return secretRotatePeriod; }
public int secretRotatePeriod() { if (null == secretRotatePeriod) { boolean validSetting = true; String s = get(SECRET_ROTATE_PERIOD, "30"); int minutes; if (!N.isInt(s)) { int seconds = Time.parseDuration(s); int reminder = seconds % 60; if (0 != reminder) { validSetting = false; seconds += (60 - reminder); } minutes = seconds / 60; } else { minutes = Integer.parseInt(s); } if (minutes <= 0) { validSetting = false; minutes = 30; } secretRotatePeriod = RotationSecretProvider.roundToPeriod(minutes); validSetting = validSetting && (secretRotatePeriod == minutes); if (!validSetting) { warn("invalid secret.rotate.period setting found: %s, system automatically set it to: %s", s, secretRotatePeriod); } } return secretRotatePeriod; }
ListPropertyGetter getter = propertyHandlerFactory.createListPropertyGetter(classList.get(0)); lastEntity = entity; if (N.isInt(prop)) { entity = getter.get(lastEntity, prop); } else {
ListPropertyGetter getter = propertyHandlerFactory.createListPropertyGetter(classList.get(0)); lastEntity = entity; if (N.isInt(prop)) { entity = getter.get(lastEntity, prop); } else {