On Android CBL, can I put/get an Enum in the properties map?
When getting the Enum value from the database, do I simply cast to an Enum?
Also in a View, can I work with the Enum as an Enum and not like a string?
Simple example to better explain my question.
public enum Animal { CAT, DOG, DEER }
If ‘properties’ is the name of the map variable, Can I then do:
Animal myAnimal = Animal.CAT;
- properties.put(“aKey”, myAnimal
- Animal x = (Animal)properties.get(“aKey”);
And in a View Mapper:
Animal x = (Animal)properties.get(“aKey”);
if (x.equals(Animal.CAT)) emit x;
And of course to use the enum as startKey and/or endKey.
Thanks
nat