public class Location extends Pazpar2ResponseData {\r
\r
private static final long serialVersionUID = -1386527442857478225L;\r
-\r
+ private int seqno = -1;\r
+ \r
public String getId() {\r
return getAttribute("id");\r
}\r
\r
+ public String getChecksum() {\r
+ logger.debug("Request to get checksum");\r
+ return getAttribute("checksum"); \r
+ }\r
+ \r
public String getName () {\r
return getAttribute("name");\r
}\r
return getOneElementValue("md-subject");\r
}\r
\r
+ public void setSequenceNumber(int num) {\r
+ seqno = num;\r
+ }\r
+ \r
+ public int getSequenceNumber () {\r
+ return seqno;\r
+ }\r
+ \r
public String getSubjects() {\r
StringBuilder builder = new StringBuilder("");\r
for (Pazpar2ResponseData data : getElements("md-subject")) {\r
\r
public List<Location> getLocations() {\r
List<Location> locations = new ArrayList<Location>();\r
- for (Pazpar2ResponseData element : getElements("location")) {\r
- locations.add((Location)element);\r
+ if (getElements("location")!=null) { \r
+ int i = 0;\r
+ for (Pazpar2ResponseData element : getElements("location")) {\r
+ ((Location)element).setSequenceNumber(i++);\r
+ locations.add((Location)element);\r
+ }\r
+ } else {\r
+ logger.debug("Found no locations");\r
}\r
return locations;\r
}\r