public class Longs extends Object
Long
type.Constructor and Description |
---|
Longs() |
Modifier and Type | Method and Description |
---|---|
static boolean |
isLong(String s)
is this String value a valid Long
|
static boolean |
nullableLongsEquals(Long number1,
Long number2)
Compares safely two nullable longs.
|
static com.google.common.base.Optional<Long> |
toLong(String value)
Deprecated.
to Use toLongMaybe instead, since v7.4.0
|
static Optional<Long> |
toLongMaybe(String value)
Parses the string argument as a
Long by delegating to Long.parseLong(String) , but returns an
Optional instead of throwing a NumberFormatException . |
@Nonnull @Deprecated public static com.google.common.base.Optional<Long> toLong(@Nullable String value)
@Nonnull public static Optional<Long> toLongMaybe(@Nullable String value)
Long
by delegating to Long.parseLong(String)
, but returns an
Optional
instead of throwing a NumberFormatException
.value
- a String
containing the Long
representation to be parsedOptional<Long>
, containing either the parsed Long
value or nothing if the value could
not be parsedpublic static boolean nullableLongsEquals(@Nullable Long number1, @Nullable Long number2)
true
if both values are null or contain equal numbers. false
otherwisepublic static boolean isLong(String s)
s
- The string to checkCopyright © 2002-2017 Atlassian. All Rights Reserved.