operator []= method
The node will have the attribute names as strings, so we translate between those and the fields of the class.
Implementation
void operator []=(String attributeName, rawValue) {
var value = Message.from(rawValue, this);
switch (attributeName) {
case "female":
female = value;
return;
case "male":
male = value;
return;
case "other":
other = value;
return;
default:
return;
}
}