'Validate that value is within range.
Validates against range-type then checks the range.
Args:
value: Value to validate.
key: Name of the field being validated.
Raises:
ValidationError: when value is out of range.  ValidationError when value
is not of the same range type.'

def Validate(self, value, key):

    cast_value = self._type_validator.Validate(value, key)
    if ((self.maximum is None) and (cast_value < self.minimum)):
        raise ValidationError(("Value    '%s'    for    %s    less    than    %s" % (value, key, self.minimum)))
    elif ((self.minimum is None) and (cast_value > self.maximum)):
        raise ValidationError(("Value    '%s'    for    %s    greater    than    %s" % (value, key, self.maximum)))
    elif (((self.minimum is not None) and (cast_value < self.minimum)) or ((self.maximum is not None) and (cast_value > self.maximum))):
        raise ValidationError(("Value    '%s'    for    %s    is    out    of    range    %s    -    %s" % (value, key, self.minimum, self.maximum)))
    return cast_value
