Created
March 7, 2014 19:07
-
-
Save antonkatz/9417748 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public String getExternalId() | |
{ | |
try { | |
for (Object identifierUncast : this.getData("identifiers")) { | |
Map.Entry<String, String> identifier = (Map.Entry<String, String>) identifierUncast; | |
if (identifier.getKey().equalsIgnoreCase("external_id")){ | |
return identifier.getValue(); | |
} | |
} | |
} catch (Exception ex) { | |
return null; | |
} | |
return null; | |
} |
Do it (almost) like this.
for (ImmutablePair<String, String> identifier : this.<ImmutablePair<String, String>>getData("identifiers")) {
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this.getData
returnsPatientData<T>
which extendsList
.List
has aget( int )
, so I can'tget("external_id")
, like you suggested. Should I do it like this, or get theXWikiDocument
and get theexternal_id
from it?