MyReader () { return (element, object, queue, virtualFile) -> { if (element instanceof JsonArrayValueAdapter) { final List<Object> objects = new ArrayList<>(); final List<JsonValueAdapter> list = ((JsonArrayValueAdapter)element).getElements(); for (JsonValueAdapter value : list) { Object enumValue = readEnumValue(value); if (enumValue == null) return; // don't validate if we have unsupported entity kinds objects.add(enumValue); } object.setEnum(objects); } }; }