Class InputValidator
java.lang.Object
com.github.natche.gravatarjavaclient.utils.InputValidator
A string validator used for validating parameter inputs.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether the provided object equals this object.static InputValidatorConstructs a new input validator from the provided input.inthashCode()Returns a hash code of this object.booleanReturns whether the encapsulated input is a valid email address.booleanReturns whether the encapsulated input is a valid image URL.toString()Returns a string representation of this object.
-
Method Details
-
from
Constructs a new input validator from the provided input.- Parameters:
input- the input- Returns:
- a new InputValidator instance
- Throws:
NullPointerException- if the provided input is nullIllegalArgumentException- if the provided input is empty
-
isValidEmailAddress
public boolean isValidEmailAddress()Returns whether the encapsulated input is a valid email address. Note, this does not check for existence, merely proper syntactical structure.- Returns:
- whether the encapsulated input is a valid email address
-
isValidImageUrl
public boolean isValidImageUrl()Returns whether the encapsulated input is a valid image URL. SeeImageIO.read(URL)for more information.- Returns:
- whether the encapsulated input is a valid image URL
-
equals
Returns whether the provided object equals this object. -
hashCode
public int hashCode()Returns a hash code of this object. -
toString
Returns a string representation of this object.
-