Universal Robots Forum

Undo redo helper function for model.set - generic method?

Any way to make a generic helper function that works for whatevet type of supported variable passed to the model.set method?

Please see attempt below.

Does not work and eclipse prints following error on set method ( I dont know why it infers boolean in this case).

The method set(String, boolean) in the type DataModel is not applicable for the arguments (String, T)

private <T> void undoRedoModelRegistration(final String key, final T value) {
	programAPI.getUndoRedoManager().recordChanges(new UndoableChanges() {
		public void executeChanges() {
			model.set(key, value);