public class InputValidator extends Object
Constructor and Description |
---|
InputValidator() |
Modifier and Type | Method and Description |
---|---|
static boolean |
areTransactionTrytes(String... trytes)
Determines whether the specified string array contains only trytes of a transaction length
|
static boolean |
areValidInputs(Input... inputs)
Checks if the inputs are valid.
|
static boolean |
areValidTags(String... tags)
Checks if the tags are valid.
|
static boolean |
areValidUris(String... uris)
Checks if the uris 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 |
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 |
isArrayOfAttachedTrytes(String[] trytes)
Checks if attached trytes if last 241 trytes are non-zero
|
static boolean |
isArrayOfHashes(String[] hashes)
Determines whether the specified array contains only valid hashes.
|
static boolean |
isArrayOfTrytes(String[] trytes)
Deprecated.
|
static boolean |
isEmptyTrytes(String trytes)
Determines whether the specified string consist only of '9'.
|
static boolean |
isHash(String hash)
Checks if input is correct hash.
|
static boolean |
isHashes(List<String> hashes)
Checks if input is correct hashes.
|
static boolean |
isNinesTrytes(String trytes,
int length)
Determines whether the specified string consist only of '9'.
|
static boolean |
isTransfersCollectionValid(List<Transfer> transfers)
Determines whether the specified transfers are valid.
|
static boolean |
isTrytes(String trytes)
Determines whether the specified string contains only characters from the trytes alphabet
|
static boolean |
isTrytesOfExactLength(String trytes,
int length)
Determines whether the specified string contains only characters from the trytes alphabet.
|
static boolean |
isTrytesOfMaxLength(String trytes,
int maxLength)
Determines whether the specified string contains only characters from the trytes alphabet
and has a maximum (including) of the provided length
|
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 |
isValidUri(String uri)
Checks if the uri is valid.
|
static boolean |
isValue(String value)
Determines whether the specified string represents a signed integer.
|
public static boolean isAddress(String address)
address
- The address to validate.true
if the specified string is an address; 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
.ArgumentException
public static boolean isAddressesArrayValid(String[] addresses) throws ArgumentException
addresses
- The address array to validate.true
if the specified addresses are valid; otherwise, false
.ArgumentException
public static boolean checkAddress(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 and have the correct size, otherwise false
.public static boolean isTrytesOfMaxLength(String trytes, int maxLength)
trytes
- The trytes to validate.maxLength
- The length.true
if the specified trytes are trytes and have the correct size, otherwise false
.public static boolean isEmptyTrytes(String trytes)
trytes
- The trytes to validate.true
if the specified string consist only of '9'; 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
.@Deprecated public static boolean isArrayOfTrytes(String[] trytes)
areTransactionTrytes(java.lang.String...)
Determines whether the specified string array contains only trytes of a transaction lengthtrytes
- The trytes array to validate.true
if the specified array contains only valid trytes otherwise, false
.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 isTransfersCollectionValid(List<Transfer> transfers) throws ArgumentException
transfers
- The transfers list to validate.true
if the specified transfers are valid; otherwise, false
.ArgumentException
- when the specified input is not valid.public static boolean isValidTransfer(Transfer transfer)
transfer
- The transfer to validate.true
if the specified transfer is valid; otherwise, false
.public static boolean areValidTags(String... tags)
tags
- The tags to validate.true
if the specified tags are valid; otherwise, false
.public static boolean isValidTag(String tag)
tag
- The tag to validate.true
if the specified tag is 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 input to validate.true
if the specified input is valid; 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 areValidUris(String... uris)
uris
- The uris to validate.true
if the specified uris are valid; otherwise, false
.public static boolean isValidUri(String uri)
uri
- The uri to validate.true
if the specified uri is valid; otherwise, false
.public static boolean areTransactionTrytes(String... trytes)
trytes
- The trytes array to validate.true
if the specified array contains only valid trytes otherwise, false
.public static boolean isArrayOfAttachedTrytes(String[] trytes)
trytes
- The trytes.true
if the specified trytes are valid; otherwise, false
.public static boolean isValidSecurityLevel(int level)
level
- the leveltrue
if the level is between 1 and 3(inclusive); otherwise, false
.Copyright © 2018. All rights reserved.