| | |
| | | } |
| | | } |
| | | |
| | | boolean isEmpty() { |
| | | return mappings.isEmpty(); |
| | | } |
| | | |
| | | @Override |
| | | void toJSON(final Context c, final Entry e, final ResultHandler<JsonValue> h) { |
| | | // Use an accumulator which will aggregate the results from the subordinate mappers into |
| | |
| | | @Override |
| | | public Map.Entry<String, JsonValue> apply(final JsonValue value, |
| | | final Void p) { |
| | | return new SimpleImmutableEntry<String, JsonValue>(mapping.name, value); |
| | | return value != null ? new SimpleImmutableEntry<String, JsonValue>( |
| | | mapping.name, value) : null; |
| | | } |
| | | }, handler)); |
| | | } |
| | |
| | | case 0: |
| | | return Collections.emptyList(); |
| | | case 1: |
| | | return value.get(0) != null ? value.get(0) : Collections |
| | | .<Attribute> emptyList(); |
| | | return value.get(0); |
| | | default: |
| | | final List<Attribute> attributes = |
| | | new ArrayList<Attribute>(value.size()); |