def METHOD_NAME(self, object, name, value):
    state_key = (object.name, object.__class__.__name__)
    if state_key in self.objects:
        id = self.objects[state_key]
    else:
        id = self.objects[state_key] = self._newId()
    if id in self.states:
        self.states[id][name] = json.dumps(value)
    else:
        self.states[id] = {name: json.dumps(value)}
    return id