@Test(expected = IllegalArgumentException.class) public void testFromMapInvalidKey() { Map<String, Object> optionsMap = new HashMap<>(); optionsMap.put("KEYS", true); IndexOptions options = IndexOptions.fromMap(optionsMap); }
public static IndexOptions fromMap(final Map<String, Object> map) { Builder builder = builder(); for (Map.Entry<String, Object> entry : map.entrySet()) { switch (entry.getKey()) { case "keys": builder.setKeys((Boolean)(entry.getValue())); break; case "trackExistence": builder.setTrackExistence((Boolean)(entry.getValue())); break; default: throw new IllegalArgumentException(String.format("Unknown index option: '%s'", entry.getKey())); } } return builder.build(); }
IndexOptions { public static IndexOptions fromMap(final Map<String, Object> map) { Builder builder = builder(); for (Map.Entry<String, Object> entry : map.entrySet()) { switch (entry.getKey()) { case "keys": builder.setKeys((Boolean)(entry.getValue())); break; case "trackExistence": builder.setTrackExistence((Boolean)(entry.getValue())); break; default: throw new IllegalArgumentException(String.format("Unknown index option: '%s'", entry.getKey())); } } return builder.build(); } }
IndexOptions { public static IndexOptions fromMap(final Map<String, Object> map) { Builder builder = builder(); for (Map.Entry<String, Object> entry : map.entrySet()) { switch (entry.getKey()) { case "keys": builder.setKeys((Boolean)(entry.getValue())); break; case "trackExistence": builder.setTrackExistence((Boolean)(entry.getValue())); break; default: throw new IllegalArgumentException(String.format("Unknown index option: '%s'", entry.getKey())); } } return builder.build(); } private  IndexOptions(@JsonProperty("keys") final boolean keys,
                         @JsonProperty("trackExistence") Boolean trackExistence); }
IndexOptions { public static IndexOptions fromMap(final Map<String, Object> map) { Builder builder = builder(); for (Map.Entry<String, Object> entry : map.entrySet()) { switch (entry.getKey()) { case "keys": builder.setKeys((Boolean)(entry.getValue())); break; case "trackExistence": builder.setTrackExistence((Boolean)(entry.getValue())); break; default: throw new IllegalArgumentException(String.format("Unknown index option: '%s'", entry.getKey())); } } return builder.build(); } private  IndexOptions(@JsonProperty("keys") final boolean keys,
                         @JsonProperty("trackExistence") Boolean trackExistence); @SuppressWarnings("WeakerAccess") static IndexOptions withDefaults(); static IndexOptions fromMap(final Map<String, Object> map); static Builder builder(); boolean isKeys(); boolean isTrackExistence(); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); }
IndexOptions { public static IndexOptions fromMap(final Map<String, Object> map) { Builder builder = builder(); for (Map.Entry<String, Object> entry : map.entrySet()) { switch (entry.getKey()) { case "keys": builder.setKeys((Boolean)(entry.getValue())); break; case "trackExistence": builder.setTrackExistence((Boolean)(entry.getValue())); break; default: throw new IllegalArgumentException(String.format("Unknown index option: '%s'", entry.getKey())); } } return builder.build(); } private  IndexOptions(@JsonProperty("keys") final boolean keys,
                         @JsonProperty("trackExistence") Boolean trackExistence); @SuppressWarnings("WeakerAccess") static IndexOptions withDefaults(); static IndexOptions fromMap(final Map<String, Object> map); static Builder builder(); boolean isKeys(); boolean isTrackExistence(); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode();  }