def METHOD_NAME(self, name: str, data: object) -> None:
    assert DC.is_dataclass(data)
    self.beginGroup(name)
    for field in DC.fields(data):
        value = getattr(data, field.name)
        try:
            assert isinstance(value, field.type)
        except AssertionError as exc:
            logger.error(
                "%s: %s of type %s is not a %s",
                name,
                field.name,
                type(value),
                field.type,
            )
            raise TypeError from exc
        self.setValue(field.name, from_type(value))
    self.endGroup()