MCPcopy
hub / github.com/oshi/oshi / parseLongOrDefault

Method parseLongOrDefault

oshi-core/src/main/java/oshi/util/ParseUtil.java:507–514  ·  view source on GitHub ↗

Attempts to parse a string to a long. If it fails, returns the default @param s The string to parse @param defaultLong The value to return if parsing fails @return The parsed long, or the default if parsing failed

(String s, long defaultLong)

Source from the content-addressed store, hash-verified

505 * @return The parsed long, or the default if parsing failed
506 */
507 public static long parseLongOrDefault(String s, long defaultLong) {
508 try {
509 return Long.parseLong(s);
510 } catch (NumberFormatException e) {
511 LOG.trace(DEFAULT_LOG_MSG, s, e);
512 return defaultLong;
513 }
514 }
515
516 /**
517 * Attempts to parse a string to an "unsigned" long. If it fails, returns the

Callers 15

queryMaxFreqMethod · 0.95
queryPageSizeMethod · 0.95
updateAttributesMethod · 0.95
getDisksMethod · 0.95
querySwapUsedMethod · 0.95
queryMaxFreqMethod · 0.95
queryPageSizeMethod · 0.95
querySwapInfoMethod · 0.95
getDisksMethod · 0.95
AixCentralProcessorClass · 0.95
getPhysicalMemoryMethod · 0.95

Calls

no outgoing calls

Tested by 1