<NME> AttributeMapper.java
<BEF> ADDFILE
<MSG> #2347: map common cache attributes of opencaching
<DFF> @@ -0,0 +1,359 @@
+package cgeo.geocaching.connector.oc;
+
+import cgeo.geocaching.enumerations.CacheAttribute;
+
+/**
+ * Maps opencaching attributes. List of available attributes is generated by accessing
+ * http://www.opencaching.de/xml/ocxml11.php?modifiedsince=20060320000000&user=0&session=0&attrlist=1
+ *
+ * <attr id="1" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/night.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/night-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/night-disabled.png">Only at
+ * night</attr>
+ * <attr id="6" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/oconly.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/oconly-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/oconly-disabled.png">Only loggable at
+ * Opencaching</attr>
+ * <attr id="7" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/wwwlink.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/wwwlink-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/wwwlink-disabled.png">Hyperlink to another
+ * caching portal only</attr>
+ * <attr id="8"
+ * icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/letter.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/letter-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/letter-disabled.png">Letterbox (needs
+ * stamp)</attr>
+ * <attr id="9" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/danger.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/danger-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/danger-disabled.png">Dangerous
+ * area</attr>
+ * <attr id="10" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/train.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/train-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/train-disabled.png">Active railway
+ * nearby</attr>
+ * <attr id="11" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/cliff.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/cliff-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/cliff-disabled.png">Cliff /
+ * Rocks</attr>
+ * <attr id="12" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/hunting.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/hunting-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/hunting-disabled.png">Hunting</attr>
+ * <attr
+ * id="13" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/thorn.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/thorn-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/thorn-disabled.png">Thorns</attr>
+ * <attr
+ * id="14" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/ticks.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/ticks-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/ticks-disabled.png">Ticks</attr>
+ * <attr
+ * id="15" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/mine.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/mine-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/mine-disabled.png">Abandoned
+ * mines</attr>
+ * <attr id="16" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/plants.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/plants-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/plants-disabled.png">Poisonous
+ * plants</attr>
+ * <attr id="17" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/animals.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/animals-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/animals-disabled.png">Dangerous
+ * animals</attr>
+ * <attr id="18" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/parking.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/parking-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/parking-disabled.png">Parking area
+ * nearby</attr>
+ * <attr id="19" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/public.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/public-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/public-disabled.png">Public
+ * transportation</attr>
+ * <attr id="20"
+ * icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/water.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/water-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/water-disabled.png">Drinking water
+ * nearby</attr>
+ * <attr id="21" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/restrooms.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/restrooms-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/restrooms-disabled.png">Public restrooms
+ * nearby</attr>
+ * <attr id="22" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/phone.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/phone-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/phone-disabled.png">Public phone
+ * nearby</attr>
+ * <attr id="23" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/firstaid.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/firstaid-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/firstaid-disabled.png">First aid
+ * available</attr>
+ * <attr id="24" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/car.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/car-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/car-disabled.png">Near the parking
+ * area</attr>
+ * <attr id="25" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/hiking.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/hiking-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/hiking-disabled.png">Long walk</attr>
+ * <attr
+ * id="26" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/wading.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/wading-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/wading-disabled.png">Swamp or
+ * marsh</attr>
+ * <attr id="27" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/steep.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/steep-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/steep-disabled.png">Hilly area</attr>
+ * <attr
+ * id="28" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/climbing.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/climbing-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/climbing-disabled.png">Some climbing (no
+ * gear needed)</attr>
+ * <attr id="29"
+ * icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/swimming.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/swimming-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/swimming-disabled.png">Swimming
+ * required</attr>
+ * <attr id="30"
+ * icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/interestsign.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/interestsign-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/interestsign-disabled.png">Point of
+ * interest</attr>
+ * <attr id="31" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/moving.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/moving-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/moving-disabled.png">Moving
+ * target</attr>
+ * <attr id="32" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/webcam.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/webcam-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/webcam-disabled.png">Webcam </attr>
+ * <attr
+ * id="33" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/indoor.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/indoor-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/indoor-disabled.png">Wihin enclosed rooms
+ * (caves, buildings etc.)</attr>
+ * <attr id="34"
+ * icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/submerged.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/submerged-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/submerged-disabled.png">In the
+ * water</attr>
+ * <attr id="35" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/nogps.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/nogps-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/nogps-disabled.png">Without GPS
+ * (letterboxes, cistes, compass juggling ...)</attr>
+ * <attr id="36"
+ * icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/fee.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/fee-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/fee-disabled.png">Access or parking
+ * fee</attr>
+ * <attr id="37" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/overnight.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/overnight-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/overnight-disabled.png">Overnight stay
+ * necessary</attr>
+ * <attr id="38"
+ * icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/available.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/available-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/available-disabled.png">Available 24
+ * hours</attr>
+ * <attr id="39" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/time.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/time-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/time-disabled.png">Only available at
+ * specified times</attr>
+ * <attr id="40"
+ * icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/day.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/day-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/day-disabled.png">by day only</attr>
+ * <attr
+ * id="41" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/tide.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/tide-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/tide-disabled.png">Tide</attr>
+ * <attr id="42"
+ * icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/date.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/date-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/date-disabled.png">All seasons</attr>
+ * <attr
+ * id="43" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/naturschutz.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/naturschutz-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/naturschutz-disabled.png">Breeding season /
+ * protected nature</attr>
+ * <attr id="44"
+ * icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/snow.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/snow-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/snow-disabled.png">Snow-proof hiding
+ * place</attr>
+ * <attr id="46" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/tools.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/tools-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/tools-disabled.png">Special
+ * equipment</attr>
+ * <attr id="47" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/compass.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/compass-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/compass-disabled.png">Compass</attr>
+ * <attr
+ * id="48" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/flashlight.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/flashlight-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/flashlight-disabled.png"
+ * >Flashlight</attr>
+ * <attr id="49"
+ * icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/rappeling.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/rappeling-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/rappeling-disabled.png">Climbing
+ * gear</attr>
+ * <attr id="50" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/cave.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/cave-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/cave-disabled.png">Cave
+ * equipment</attr>
+ * <attr id="51" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/scuba.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/scuba-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/scuba-disabled.png">Diving
+ * equipment</attr>
+ * <attr id="52" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/boat.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/boat-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/boat-disabled.png">Watercraft</attr>
+ * <attr
+ * id="53" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/aircraft.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/aircraft-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/aircraft-disabled.png">Aircraft</attr>
+ * <attr
+ * id="54" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/wiki.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/wiki-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/wiki-disabled.png"
+ * >Investigation</attr>
+ * <attr id="55"
+ * icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/riddle.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/riddle-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/riddle-disabled.png">Puzzle /
+ * Mystery</attr>
+ * <attr id="56" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/arith_prob.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/arith_prob-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/arith_prob-disabled.png">Arithmetical
+ * problem</attr>
+ * <attr id="57" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/othercache.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/othercache-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/othercache-disabled.png">Other cache
+ * type</attr>
+ * <attr id="58" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/ask.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/ask-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/ask-disabled.png">Ask owner for start
+ * conditions</attr>
+ * <attr id="59" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/kids.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/kids-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/kids-disabled.png">Suited for
+ * children</attr>
+ * <attr id="60" icon_large="http://www.opencaching.de/resource2/ocstyle/images/attributes/calendar.png"
+ * icon_no="http://www.opencaching.de/resource2/ocstyle/images/attributes/calendar-no.png"
+ * icon_undef="http://www.opencaching.de/resource2/ocstyle/images/attributes/calendar-disabled.png">Only available
+ * during specified seasons</attr>
+ *
+ */
+public class AttributeMapper {
+    public static CacheAttribute getAttribute(int ocAttributeId) {
+        switch (ocAttributeId) {
+            case 1:
+                return CacheAttribute.NIGHT;
+            case 6:
+                return null;
+            case 7:
+                return null;
+            case 8:
+                return null;
+            case 9:
+                return CacheAttribute.DANGER;
+            case 10:
+                return null;
+            case 11:
+                return CacheAttribute.CLIFF;
+            case 12:
+                return CacheAttribute.HUNTING;
+            case 13:
+                return CacheAttribute.THORN;
+            case 14:
+                return CacheAttribute.TICKS;
+            case 15:
+                return CacheAttribute.MINE;
+            case 16:
+                return CacheAttribute.POISONOAK;
+            case 17:
+                return CacheAttribute.DANGEROUSANIMALS;
+            case 18:
+                return CacheAttribute.PARKING;
+            case 19:
+                return CacheAttribute.PUBLIC;
+            case 20:
+                return CacheAttribute.WATER;
+            case 21:
+                return CacheAttribute.RESTROOMS;
+            case 22:
+                return CacheAttribute.PHONE;
+            case 23:
+                return CacheAttribute.FIRSTAID;
+            case 24:
+                return CacheAttribute.PARKNGRAB;
+            case 25:
+                return CacheAttribute.HIKING;
+            case 26:
+                return null;
+            case 27:
+                return null;
+            case 28:
+                return CacheAttribute.CLIMBING;
+            case 29:
+                return CacheAttribute.SWIMMING;
+            case 30:
+                return null;
+            case 31:
+                return null;
+            case 32:
+                return null; // webcam, should be handled fine by type already
+            case 33:
+                return null;
+            case 34:
+                return null;
+            case 35:
+                return null;
+            case 36:
+                return CacheAttribute.FEE;
+            case 37:
+                return null;
+            case 38:
+                return CacheAttribute.AVAILABLE;
+            case 39:
+                return null;
+            case 40:
+                return null;
+            case 41:
+                return null;
+            case 42:
+                return null;
+            case 43:
+                return null;
+            case 44:
+                return null;
+            case 46:
+                return CacheAttribute.SPECIAL_TOOLS;
+            case 47:
+                return null;
+            case 48:
+                return CacheAttribute.FLASHLIGHT;
+            case 49:
+                return CacheAttribute.RAPPELLING;
+            case 50:
+                return null;
+            case 51:
+                return CacheAttribute.SCUBA;
+            case 52:
+                return CacheAttribute.BOAT;
+            case 53:
+                return null;
+            case 54:
+                return null;
+            case 55:
+                return null;
+            case 56:
+                return null;
+            case 57:
+                return null;
+            case 58:
+                return null;
+            case 59:
+                return CacheAttribute.KIDS;
+            case 60:
+                return CacheAttribute.SEASONAL;
+            default:
+                return null;
+        }
+    }
+}
\ No newline at end of file

#2347: map common cache attributes of opencaching