|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.unboundid.util.args.ArgumentValueValidator
com.unboundid.util.args.IPAddressArgumentValueValidator
@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class IPAddressArgumentValueValidator
This class provides an implementation of an argument value validator that ensures that values can be parsed as valid IPv4 or IPV6 addresses.
Constructor Summary | |
---|---|
IPAddressArgumentValueValidator()
Creates a new IP address argument value validator that will accept both IPv4 and IPv6 addresses. |
|
IPAddressArgumentValueValidator(boolean acceptIPv4Addresses,
boolean acceptIPv6Addresses)
Creates a new IP address argument value validator that will accept both IPv4 and IPv6 addresses. |
Method Summary | |
---|---|
boolean |
acceptIPv4Addresses()
Indicates whether to accept IPv4 addresses. |
boolean |
acceptIPv6Addresses()
Indicates whether to accept IPv6 addresses. |
java.lang.String |
toString()
Retrieves a string representation of this argument value validator. |
void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of this argument value validator to the provided buffer. |
void |
validateArgumentValue(Argument argument,
java.lang.String valueString)
Examines the value(s) assigned to the provided argument to determine whether they are acceptable. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public IPAddressArgumentValueValidator()
public IPAddressArgumentValueValidator(boolean acceptIPv4Addresses, boolean acceptIPv6Addresses)
acceptIPv4Addresses
and acceptIPv6Addresses
arguments must have a value of
true
.
acceptIPv4Addresses
- Indicates whether IPv4 addresses will be
accepted. If this is false
, then the
acceptIPv6Addresses
argument must be
true
.acceptIPv6Addresses
- Indicates whether IPv6 addresses will be
accepted. If this is false
, then the
acceptIPv4Addresses
argument must be
true
.Method Detail |
---|
public boolean acceptIPv4Addresses()
true
if IPv4 addresses should be accepted, or
false
if not.public boolean acceptIPv6Addresses()
true
if IPv6 addresses should be accepted, or
false
if not.public void validateArgumentValue(Argument argument, java.lang.String valueString) throws ArgumentException
validateArgumentValue
in class ArgumentValueValidator
argument
- The argument to which the value is being provided.valueString
- The string representation of the value to be
validated. This value will have already passed any
normal validation performed by the argument.
ArgumentException
- If the provided value is determined to be
unacceptable.public java.lang.String toString()
toString
in class java.lang.Object
public void toString(java.lang.StringBuilder buffer)
buffer
- The buffer to which the string representation should be
appended.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |