public class StripeTextUtils
extends java.lang.Object
| Constructor and Description |
|---|
StripeTextUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
asCardBrand(java.lang.String possibleCardType)
Converts an unchecked String value to a
Card.CardBrand or null. |
static java.lang.String |
asFundingType(java.lang.String possibleFundingType)
Converts an unchecked String value to a
Card.FundingType or null. |
static java.lang.String |
asTokenType(java.lang.String possibleTokenType)
Converts an unchecked String value to a
Token.TokenType or null. |
static boolean |
hasAnyPrefix(java.lang.String number,
java.lang.String... prefixes)
Check to see if the input number has any of the given prefixes.
|
static boolean |
isBlank(java.lang.String value)
A checker for whether or not the input value is entirely whitespace.
|
static boolean |
isWholePositiveNumber(java.lang.String value)
Check to see whether the input string is a whole, positive number.
|
static java.lang.String |
nullIfBlank(java.lang.String value)
Swap
null for blank text values. |
public static boolean hasAnyPrefix(java.lang.String number,
java.lang.String... prefixes)
number - the number to testprefixes - the prefixes to test againsttrue if number begins with any of the input prefixespublic static boolean isWholePositiveNumber(java.lang.String value)
value - the input string to testtrue if the input value consists entirely of integerspublic static java.lang.String nullIfBlank(java.lang.String value)
null for blank text values.value - an input string that may or may not be entirely whitespacenull if the string is entirely whitespace, or the original value if notpublic static boolean isBlank(java.lang.String value)
null or "".value - a possibly blank input string valuetrue if and only if the value is all whitespace, null, or empty@Nullable
public static java.lang.String asCardBrand(@Nullable
java.lang.String possibleCardType)
Card.CardBrand or null.possibleCardType - a String that might match a Card.CardBrand or be empty.null if the input is blank, else the appropriate Card.CardBrand.@Nullable
public static java.lang.String asFundingType(@Nullable
java.lang.String possibleFundingType)
Card.FundingType or null.possibleFundingType - a String that might match a Card.FundingType or be emptynull if the input is blank, else the appropriate Card.FundingType@Nullable
public static java.lang.String asTokenType(@Nullable
java.lang.String possibleTokenType)
Token.TokenType or null.possibleTokenType - a String that might match a Token.TokenType or be emptynull if the input is blank or otherwise does not match a Token.TokenType,
else the appropriate Token.TokenType.