package com.michelboudreau.alternator.validators;

import com.amazonaws.services.dynamodb.model.ProvisionedThroughput;
import com.michelboudreau.alternator.models.Limits;
import com.michelboudreau.alternator.validation.Validator;
import com.michelboudreau.alternator.validation.ValidatorUtils;

import java.util.List;

public class ProvisionedThroughputValidator extends Validator {

	public Boolean supports(Class clazz) {
		return ProvisionedThroughput.class.isAssignableFrom(clazz);
	}

	public List<Error> validate(Object target) {
		ProvisionedThroughput instance = (ProvisionedThroughput) target;
		List<Error> errors = ValidatorUtils.rejectIfNull(instance);
		if (errors.size() == 0) {
			errors.addAll(ValidatorUtils.rejectIfSizeOutOfBounds(instance.getWriteCapacityUnits(), 5, Limits.NUMBER_MAX));
			errors.addAll(ValidatorUtils.rejectIfSizeOutOfBounds(instance.getReadCapacityUnits(), 5, Limits.NUMBER_MAX));
		}

		return removeNulls(errors);
	}
}

@@ -768,33 +768,33 @@
 apacityUnits(), 
-5
+1
 , Limits.NUMBER_
@@ -893,9 +893,9 @@
 (), 
-5
+1
 , Li

Update src/main/java/com/michelboudreau/alternator/validators/ProvisionedThroughputValidator.java