Archived
This forum has been archived. Please start a new discussion on GitHub.
java dictionaries
xdm
La Coruña, Spain
in Help Center
hello can anybody say me what is the correct way to return a proxy stored in a java dictionary.
Below i show an example of what i'm trying to do
Below i show an example of what i'm trying to do
class FopProcesor
{
}
dictionray <Ice::Identity,FopProceso*>FopProcesorMap;
class FopServer
{
FopProcesorMap procesors;
FopProcesorMap getProcesor(Ice::Identity procesorId);
}
public class XslFooServerI extends XslFooServer
{
public XslFooFopPrx getFopProcesor(Ice.Identity idProcesor,Ice.Current current)
{
return procesors.getKey(idProcesor);
}
}
ouput error when build
XslFooServerI.java:13: cannot resolve symbol
[javac] symbol : method getKey (Ice.Identity)
0
Comments
-
You need to use get(), not getKey(). For example, if you know that all values in the map are of type XslFooFopPrx, you can do the following:
return (XslFooFopPrx)procesors.get(idProcesor);
If the proxies are of various types, you can do this:FopProcesorPrx proxy = (FopProcesorPrx)procesors.get(idProcesor); return XslFooFopPrxHelper.uncheckedCast(proxy);
- Mark0