com.cisco.oss.foundation.configuration.validation.params
Class ParamValidators.HEXValidator
java.lang.Object
com.cisco.oss.foundation.configuration.validation.params.ParamValidators.ParamValidator<String>
com.cisco.oss.foundation.configuration.validation.params.ParamValidators.HEXValidator
- Enclosing class:
- ParamValidators
public static class ParamValidators.HEXValidator
- extends ParamValidators.ParamValidator<String>
a validator for verifying that a given string is a valid hexadecimal value
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ParamValidators.HEXValidator
public ParamValidators.HEXValidator(boolean required,
int maxLength,
boolean lengthInBits,
boolean exactLength)
ParamValidators.HEXValidator
public ParamValidators.HEXValidator(boolean required,
double maxValue)
instance
public static ParamValidators.ParamValidator instance(boolean required)
instance
public static ParamValidators.ParamValidator instance(Param<Boolean> param)
validate
public void validate(String name,
String value)
- Overrides:
validate in class ParamValidators.ParamValidator<String>
validateHexValue
public static String validateHexValue(String hexValue,
int maxLength,
boolean lengthInBits,
boolean exactLength)
- validates that the given string is a valid hexadecimal string
- Parameters:
hexValue - the string value to checkmaxLength - maximum length of hexadecimal value or a negative value if length is not verifiedlengthInBits - indicates if the parameter refers to the hexadecimal in its bits representation
(true) or to its number of characters (false)exactLength - indicates if the parameter should be exactly the size of the hexadecimal value
- Returns:
- if validation is OK or the exact error reason if validation is failed
validateHexValue
public static String validateHexValue(String hexValue)
validateHexValue
public static String validateHexValue(String hexValue,
double maxValue)
Copyright © 2014 Cisco. All Rights Reserved.