@classmethod
def serialize_value(cls, _type, value):
    """Serialize the typed value as a string"""
    _type = cls.TYPE_ALIAS.get(_type, _type)
    if (_type in cls.INT_TYPES + cls.UINT_TYPES + cls.FLOAT_TYPES + cls.
        FRACTION_TYPES):
        return str(value)
    if _type in cls.BOOLEAN_TYPES:
        if value:
            return 'true'
        return 'false'
    if _type in cls.STRING_TYPES:
        if value is not None and type(value) is not str:
            value = value.encode('utf8')
        return cls.serialize_string(value)
    raise ValueError(
        'The type {} is unknown, so the value ({}) can not be serialized.'.
        format(_type, str(value)))
