org.kitesdk.morphline.base
Class Validator<T>

java.lang.Object
  extended by org.kitesdk.morphline.base.Validator<T>

public final class Validator<T>
extends Object

Simple helper to validate user configurable parameters.


Constructor Summary
Validator()
           
 
Method Summary
<T extends Enum<T>>
T
validateEnum(com.typesafe.config.Config config, String value, Class<T> type, T... choices)
          Validates that an enum of the given type with the given value exists, and that this enum is contained in the given list of permitted choices; finally returns that enum object.
 void validateRange(com.typesafe.config.Config config, T value, Comparable<T> min, Comparable<T> max)
          Validates that the given value is contained in the range [min, max]
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Validator

public Validator()
Method Detail

validateRange

public void validateRange(com.typesafe.config.Config config,
                          T value,
                          Comparable<T> min,
                          Comparable<T> max)
Validates that the given value is contained in the range [min, max]


validateEnum

public <T extends Enum<T>> T validateEnum(com.typesafe.config.Config config,
                                          String value,
                                          Class<T> type,
                                          T... choices)
Validates that an enum of the given type with the given value exists, and that this enum is contained in the given list of permitted choices; finally returns that enum object.



Copyright © 2013–2014. All rights reserved.