Package com.atlassian.jira.util
Class Longs
java.lang.Object
com.atlassian.jira.util.Longs
Contains static utility methods pertaining to the
Long type.- Since:
- 6.4.9
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanis this String value a valid Longstatic booleannullableLongsEquals(Long number1, Long number2) Compares safely two nullable longs.static com.google.common.base.Optional<Long> Deprecated.to Use toLongMaybe instead, since v7.4.0toLongMaybe(String value) Parses the string argument as aLongby delegating toLong.parseLong(String), but returns anOptional<Long>instead of throwing aNumberFormatException.
-
Constructor Details
-
Longs
public Longs()
-
-
Method Details
-
toLong
@Nonnull @Deprecated public static com.google.common.base.Optional<Long> toLong(@Nullable String value) Deprecated.to Use toLongMaybe instead, since v7.4.0 -
toLongMaybe
Parses the string argument as aLongby delegating toLong.parseLong(String), but returns anOptional<Long>instead of throwing aNumberFormatException.- Parameters:
value- aStringcontaining theLongrepresentation to be parsed- Returns:
- an
Optional<Long>, containing either the parsedLongvalue or nothing if the value could not be parsed - Since:
- v7.4.0
-
nullableLongsEquals
Compares safely two nullable longs.- Returns:
trueif both values are null or contain equal numbers.falseotherwise
-
isLong
is this String value a valid Long- Parameters:
s- The string to check- Returns:
- True if valid long, false otherwise
- Since:
- v7.4.0
-