Class InputValidator
java.lang.Object
com.github.natche.gravatarjavaclient.utils.InputValidator
A string validator used for validating parameter inputs.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisValidEmailAddress(String input) Returns whether the provided input is a valid email address.static booleanisValidFilename(String input) Returns whether the provided input is a valid filename for this operating system.static booleanisValidImageUrl(String input) Returns whether the provided input is a valid image URL.
-
Constructor Details
-
InputValidator
public InputValidator()
-
-
Method Details
-
isValidEmailAddress
Returns whether the provided input is a valid email address. Note, this does not check for existence, merely proper syntactical structure.- Parameters:
input- the input- Returns:
- whether the encapsulated input is a valid email address
-
isValidImageUrl
Returns whether the provided input is a valid image URL. SeeImageIO.read(URL)for more information.- Parameters:
input- the input- Returns:
- whether the encapsulated input is a valid image URL
-
isValidFilename
Returns whether the provided input is a valid filename for this operating system.- Parameters:
input- the input to use as a filename- Returns:
- whether the provided filename is valid for this operating system
- Throws:
NullPointerException- if the provided filename is nullIllegalArgumentException- if the provided filename is empty
-