← Back to team overview

mugle-dev team mailing list archive

Re: Getting a Key from a Long

 

>
> Hi Prageeth,
>
> You have done this type of thing haven't you? If I have a long which is the
> key ID (from the server), and I know the type of the key, how do I build a
> Key object from that?
>
> Basically I have a URL which has a GameVersion key (as an integer) and I
> need to get the Key to the GameVersion.
>
> Matt



Basically there's no direct way to do that. But internally, the PMF does the
conversion; you don't need to explicitly convert.

To get an object by key, use can use:

 pm.getObjectByKey(ClassType, key);

where the key can be either of type Long or Key.

Hope this helps.

-- 
*Prageeth Silva*

Follow ups

References