@classmethod
def create(cls, mapping):
    """
        Create a mapping object
        @param cls:
        @type cls:
        @param mapping: mapping object or properties dict
        @type mapping: pylastica.doc_type.Mapping or dict
        @return:
        @rtype: pylastica.doc_type.Mapping
        """
    if isinstance(mapping, dict):
        mapping_object = cls()
        mapping_object.set_properties(mapping)
    else:
        mapping_object = mapping
    assert isinstance(mapping_object, cls), 'Invalid object type'
    return mapping_object
