package org.syndicate_lang.actors.example.example1; import org.syndicate_lang.actors.Entity; import org.syndicate_lang.actors.Turn; public class ValueHolder extends Entity { private T value; public ValueHolder(T initialValue) { this.value = initialValue; } @Override public void message_(Turn turn, Object body) { if (body instanceof IValueHolder.Get op) { turn.message_(op.k(), this.value); } else if (body instanceof IValueHolder.Set) { IValueHolder.Set op = (IValueHolder.Set) body; this.value = op.newValue(); } } }