com.bigdata.config
Class LongValidator

java.lang.Object
  extended by com.bigdata.config.LongValidator
All Implemented Interfaces:
IValidator<Long>
Direct Known Subclasses:
LongRangeValidator

public class LongValidator
extends Object
implements IValidator<Long>

Base impl for Long.

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

Field Summary
static IValidator<Long> DEFAULT
          Allows all values.
static IValidator<Long> GT_ZERO
          Only allows positive values (GT ZERO).
static IValidator<Long> GTE_ZERO
          Only allows non-negative values (GTE ZERO).
 
Constructor Summary
protected LongValidator()
           
 
Method Summary
 void accept(String key, String val, Long arg)
          Accepts all values by default.
 Long 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<Long> DEFAULT
Allows all values.


GTE_ZERO

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


GT_ZERO

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

Constructor Detail

LongValidator

protected LongValidator()
Method Detail

parse

public Long 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<Long>
Parameters:
key - The key.
val - The value.
Returns:
The converted value.

accept

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

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


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