I am still stuck with the following issue -
I have various scripts that I call using
callScript() to return a
Map<Item,State> which I then pass to the
restoreStates(Map<Item,State>) action to set the state of the items.
The issue is that, as far as I can see, there is no way to declare a variable of type
Map<Item,State> due to the fact that
Item is a reserved word in the DSL.
As @rlkoshak suggested in one of the other threads, it is possible to declare a variable of type
Map<GenericItem,State> however this is not acceptable to
restoreStates() since it explicitly requires
callScript() command and returning a
Map<Item,State> is possible but the
callScript() command actually returns an
Object so I need to cast it to a
Map<Item,State> in order for it to be accepted by
restoreStates(), which can’t be done.
It seems very awkward for the
restoreStates() functions use
Map<Item,State> rather than
Map<GenericItem,State>. There may well be a reason why it has to be like this but any ideas as to how to solve my problem would be greatly appreciated.