Type casting in compiled JavaFX
I am using a HashMap to store a bunch of model objects (created in JavaFX) for later retrieval purposes.
<br /> attribute someMap = new HashMap();<br /> ...<br /> someMap.put("id", someModel);<br /> ...<br />
I then try to retrieve it as in normal Java, which works fine and returns me an Object. When I print out the Object to the console, it tells me that it is of type of someModel, however, when I try to invoke a method on it, I get the good old cannot find symbol error.
I used to be able to cast it in the traditional Java style in Interpreted JavaFX which no longer seems to work (I get a very long error basically saying the syntax is wrong)
<br /> var model = (SomeModel)someMap.get("id");<br />
And the following code gives me a incompatible type error, which makes sense.
<br /> var model: SomeModel = someMap.get("id");<br />
So, what is the new syntax (if there is one) or the correct way of casting types in Compiled JavaFX?