com.cisco.oss.foundation.configuration.validation.params
Class ParamValidators.HEXValidator

java.lang.Object
  extended by com.cisco.oss.foundation.configuration.validation.params.ParamValidators.ParamValidator<String>
      extended by 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


Field Summary
 
Fields inherited from class com.cisco.oss.foundation.configuration.validation.params.ParamValidators.ParamValidator
required
 
Constructor Summary
ParamValidators.HEXValidator(boolean required, double maxValue)
           
ParamValidators.HEXValidator(boolean required, int maxLength, boolean lengthInBits, boolean exactLength)
           
 
Method Summary
static ParamValidators.ParamValidator instance(boolean required)
           
static ParamValidators.ParamValidator instance(Param<Boolean> param)
           
 void validate(String name, String value)
           
static String validateHexValue(String hexValue)
           
static String validateHexValue(String hexValue, double maxValue)
           
static String validateHexValue(String hexValue, int maxLength, boolean lengthInBits, boolean exactLength)
          validates that the given string is a valid hexadecimal string
 
Methods inherited from class com.cisco.oss.foundation.configuration.validation.params.ParamValidators.ParamValidator
isRequired, validateAndReturnIfEmpty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParamValidators.HEXValidator

public ParamValidators.HEXValidator(boolean required,
                                    int maxLength,
                                    boolean lengthInBits,
                                    boolean exactLength)

ParamValidators.HEXValidator

public ParamValidators.HEXValidator(boolean required,
                                    double maxValue)
Method Detail

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 check
maxLength - maximum length of hexadecimal value or a negative value if length is not verified
lengthInBits - 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.