Search in sources :

Example 1 with Type

use of eu.esdihumboldt.util.validator.LengthValidator.Type in project hale by halestudio.

the class LengthValidatorFactory method restore.

@Override
public Validator restore(Value value) throws Exception {
    ValueProperties props = value.as(ValueProperties.class);
    Type type = Type.valueOf(props.getSafe(P_TYPE).as(String.class));
    int length = props.getSafe(P_LENGTH).as(Integer.class);
    return new LengthValidator(type, length);
}
Also used : LengthValidator(eu.esdihumboldt.util.validator.LengthValidator) Type(eu.esdihumboldt.util.validator.LengthValidator.Type) ValueProperties(eu.esdihumboldt.hale.common.core.io.ValueProperties)

Aggregations

ValueProperties (eu.esdihumboldt.hale.common.core.io.ValueProperties)1 LengthValidator (eu.esdihumboldt.util.validator.LengthValidator)1 Type (eu.esdihumboldt.util.validator.LengthValidator.Type)1