'Returns the value in the schema\'s data type.'

def to_schema_type(self, value):

    try:
        if (self.type == self.INTEGER):
            num = Schema.str_to_num(value)
            if isinstance(num, float):
                raise ValueError((_('%s    is    not    an    integer.') % num))
            return num
        elif (self.type == self.NUMBER):
            return Schema.str_to_num(value)
        elif (self.type == self.STRING):
            return six.text_type(value)
        elif (self.type == self.BOOLEAN):
            return strutils.bool_from_string(str(value), strict=True)
    except ValueError:
        raise ValueError((_('Value    "%(val)s"    is    invalid    for    data    type    "%(type)s".') % {'val': value, 'type': self.type}))
    return value
