I had a question concerning the Java SDK (2.2.3) and I wanted to know how if it was possible to get the content type of a specific data in a bucket.
Let’s consider the following example: I have configured a bucket containing three types of data: JsonDocument, StringDocument and JsonBooleanDocument.
When I need to retrieve the value related to a specific key, so far the only way I found was to do the job like that:
- If I got an exception (not a JsonDocument) => bucket.get(key, StringDocument.class)
- If I got an exception (not a StringDocument) => bucket.get(key, JsonBooleanDocument.class)
Is there any way to do it smarter? Is it possible to retrieve the value type in advance for instance?
Thanks for your help