com.bigdata.config
Class IntegerValidator

java.lang.Object
  extended by com.bigdata.config.IntegerValidator
All Implemented Interfaces:
IValidator<Integer>
Direct Known Subclasses:
IntegerRangeValidator

public class IntegerValidator
extends Object
implements IValidator<Integer>

Base impl for Integer.

Version:
$Id: IntegerValidator.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson

Field Summary
static IValidator<Integer> DEFAULT
          Allows all values.
static IValidator<Integer> GT_ZERO
          Only allows positive values (GT ZERO).
static IValidator<Integer> GTE_ZERO
          Only allows non-negative values (GTE ZERO).
 
Constructor Summary
IntegerValidator()
           
 
Method Summary
 void accept(String key, String val, Integer arg)
          Accepts all values by default.
 Integer parse(String key, String val)
          Convert a value to an instance of the generic type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT

public static final transient IValidator<Integer> DEFAULT
Allows all values.


GTE_ZERO

public static final transient IValidator<Integer> GTE_ZERO
Only allows non-negative values (GTE ZERO).


GT_ZERO

public static final transient IValidator<Integer> GT_ZERO
Only allows positive values (GT ZERO).

Constructor Detail

IntegerValidator

public IntegerValidator()
Method Detail

parse

public Integer parse(String key,
                     String val)
Description copied from interface: IValidator
Convert a value to an instance of the generic type.

Specified by:
parse in interface IValidator<Integer>
Parameters:
key - The key.
val - The value.
Returns:
The converted value.

accept

public void accept(String key,
                   String val,
                   Integer arg)
            throws ConfigurationException
Accepts all values by default.

Specified by:
accept in interface IValidator<Integer>
Parameters:
key - The key under which the value was discovered.
val - The value.
arg - The parsed value.
Throws:
ConfigurationException


Copyright © 2006-2009 SYSTAP, LLC. All Rights Reserved.