public class InputValidator extends Object
| Constructor and Description |
|---|
InputValidator() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
areValidInputs(Input... inputs)
Checks if the inputs are valid.
|
static boolean |
areValidInputsList(List<Input> inputs)
Checks if the inputs are valid.
|
static boolean |
areValidTags(String... tags)
Checks if the tags are valid.
|
static boolean |
checkAddress(String address)
Checks whether the specified address is an address and throws and exception if the address is invalid.
|
static boolean |
checkAddressWithoutChecksum(String address)
Checks whether the specified address is an address without checksum
and throws and exception if the address is invalid.
|
static boolean |
hasTrailingZeroTrit(String trytes)
According to the following issue:
https://github.com/iotaledger/trinity-wallet/issues/866
This is because Curl addresses always are with a 0 trit on the end.
|
static boolean |
isAddress(String address)
Determines whether the specified string is an address.
|
static boolean |
isAddressesArrayValid(String[] addresses)
Determines whether the specified addresses are valid.
|
static boolean |
isAddressesCollectionValid(List<String> addresses)
Determines whether the specified addresses are valid.
|
static boolean |
isAddressWithoutChecksum(String address)
Determines whether the specified string is an address without checksum.
|
static boolean |
isArrayOfAttachedTrytes(String[] trytes)
Checks if attached trytes if last 241 trytes are non-zero
the last 243 trytes basically consist of the: trunkTransaction + branchTransaction + nonce
|
static boolean |
isArrayOfHashes(String[] hashes)
Determines whether the specified array contains only valid hashes.
|
static boolean |
isArrayOfRawTransactionTrytes(String[] trytes)
Determines whether the specified string array contains only trytes, and
|
static boolean |
isArrayOfTrytes(String[] trytes)
Determines whether the specified string array contains only trytes
|
static boolean |
isArrayOfTrytes(String[] trytes,
int length)
Determines whether the specified string array contains only trytes.
|
static boolean |
isHash(String hash)
Checks if input is correct hash.
|
static boolean |
isHashes(List<String> hashes)
Determines whether the specified array contains only valid hashes.
|
static boolean |
isNinesTrytes(String trytes,
int length)
Determines whether the specified string consist only of '9'.
|
static boolean |
isStringArrayValid(String[] data)
Checks if the array is not null and not empty
|
static boolean |
isTag(String tag)
Checks if the tag is valid.
|
static boolean |
isTransfersCollectionValid(List<Transfer> transfers)
Determines whether the specified transfers are valid.
|
static boolean |
isTrits(int[] trits) |
static boolean |
isTrits(List<Integer> trits) |
static boolean |
isTrytes(String trytes)
Determines whether the specified string contains only characters from the trytes alphabet (see
|
static boolean |
isTrytes(String trytes,
int length)
Determines whether the specified string contains only characters from the trytes alphabet (see
|
static boolean |
isTrytesOfExactLength(String trytes,
int length)
Determines whether the specified string contains only characters from the trytes alphabet (see
|
static boolean |
isValidInput(Input input)
Checks if the input is valid.
|
static boolean |
isValidSecurityLevel(int level)
Checks if the security level is valid
|
static boolean |
isValidSeed(String seed)
Checks if the seed is valid.
|
static boolean |
isValidTag(String tag)
Checks if the tag is valid.
|
static boolean |
isValidTransfer(Transfer transfer)
Determines whether the specified transfer is valid.
|
static boolean |
isValue(String value)
Determines whether the specified string represents a signed integer.
|
static int |
requireValidSecurityLevel(int securityLevel)
Checks that the specified security level reference is a valid security level.
|
static String |
requireValidSeed(String seed)
Checks that the specified seed reference is a valid seed.
|
public static boolean isAddress(String address)
address - The address to validate.true if the specified string is an address; otherwise, false.public static boolean isAddressWithoutChecksum(String address)
address - The address to validate.true if the specified string is an address; otherwise, false.public static boolean hasTrailingZeroTrit(String trytes)
trytes - The trytes to checktrue if the specified trytes end with 0, otherwise false.public static boolean isAddressesCollectionValid(List<String> addresses) throws ArgumentException
addresses - The address list to validate.true if the specified addresses are valid; otherwise, false.ArgumentExceptionpublic static boolean isAddressesArrayValid(String[] addresses) throws ArgumentException
addresses - The address array to validate.true if the specified addresses are valid; otherwise, false.ArgumentExceptionpublic static boolean checkAddress(String address) throws ArgumentException
address - The address to validate.true if the specified string is an address; otherwise, false.ArgumentException - is thrown when the specified input is not valid.public static boolean checkAddressWithoutChecksum(String address) throws ArgumentException
address - The address to validate.true if the specified string is an address; otherwise, false.ArgumentException - when the specified input is not valid.public static boolean isTrytes(String trytes)
trytes - The trytes to validate.true if the specified trytes are trytes otherwise, false.public static boolean isTrytesOfExactLength(String trytes, int length)
trytes - The trytes to validate.length - The length.true if the specified trytes are trytes otherwise, false.public static boolean isTrytes(String trytes, int length)
isTrytesOfExactLength(String, int)trytes - The trytes to validate.length - The length.true if the specified trytes are trytes otherwise, false.public static boolean isNinesTrytes(String trytes, int length)
trytes - The trytes to validate.length - The length.true if the specified string consist only of '9'; otherwise, false.public static boolean isValue(String value)
value - The value to validate.true the specified string represents an integer value; otherwise, false.public static boolean isArrayOfTrytes(String[] trytes)
trytes - The trytes array to validate.true if the specified array contains only valid trytes otherwise, false.public static boolean isArrayOfRawTransactionTrytes(String[] trytes)
trytes - The trytes array to validate.true if the specified array contains only valid trytes otherwise, false.public static boolean isArrayOfTrytes(String[] trytes, int length)
trytes - The trytes array to validate.length - The length each String should betrue if the specified array contains only valid trytes otherwise, false.public static boolean isStringArrayValid(String[] data)
data - The array with datatrue if the array is valid; otherwise, false.public static boolean isTransfersCollectionValid(List<Transfer> transfers) throws ArgumentException
transfers - The transfers list to validate.true if the specified transfers are valid; otherwise, false.ArgumentExceptionpublic static boolean isValidTransfer(Transfer transfer)
transfer - The transfer to validate.true if the specified transfer is valid; otherwise, false>.public static boolean isTag(String tag)
isValidTag(String)tag - The tag to validate.true if the specified tag is valid; otherwise, false.public static boolean isValidTag(String tag)
tag - The tag to validate.true if the specified tag is valid; otherwise, false.isTrytes(String)public static boolean areValidTags(String... tags)
tags - The tags to validate.true if all the tags are valid; otherwise, false.public static boolean areValidInputsList(List<Input> inputs)
inputs - The inputs to validate.true if the specified inputs are valid; otherwise, false.public static boolean areValidInputs(Input... inputs)
inputs - The inputs to validate.true if the specified inputs are valid; otherwise, false.public static boolean isValidInput(Input input)
input - The input to validate.true if the specified input is valid; otherwise, false.public static boolean isValidSeed(String seed)
seed - The seed to validate.true if the specified seed is valid; otherwise, false.public static String requireValidSeed(String seed)
seed - The seed to validate.seed if valid seedIllegalArgumentException - if seed is invalidisValidSeed(String)public static boolean isArrayOfHashes(String[] hashes)
hashes - The hashes array to validate.true the specified array contains only valid hashes; otherwise, false.public static boolean isHashes(List<String> hashes)
hashes - The hashes list to validate.true if the specified hashes are valid; otherwise, false.public static boolean isHash(String hash)
hash - The hash to validate.true if the specified hash are valid; otherwise, false.public static boolean isArrayOfAttachedTrytes(String[] trytes)
trytes - The trytes.true if the specified trytes are valid/non 9s; otherwise, false.public static boolean isValidSecurityLevel(int level)
level - the leveltrue if the level is between 1 and 3(inclusive); otherwise, false.public static int requireValidSecurityLevel(int securityLevel)
securityLevel - The security level to validate.securityLevel if valid security levelIllegalArgumentException - if securityLevel is invalidisValidSecurityLevel(int)public static boolean isTrits(int[] trits)
Copyright © 2019. All rights reserved.