public final class PropertiesMap extends Object
GraphQL has no support for maps, and typically a map like object will get convented to a list of key, value. In the value of generic object value its very difficult for GraphQL to know what to do with the object. it becomes an ObjectScalar (raw JSON). This works for querying but not for input.
We introduce here a PropertiesMap which we manage the serialisation for as a dedicated scalar. It is really a LinkedHashMap which mirrors the map-like / list-like constructs we'd expect in Java / GraphQL representations.
Developers should use this in GraphQL 'dtos' wherever they'd normally wish to use a Map<String,Object>.
| Constructor and Description |
|---|
PropertiesMap() |
PropertiesMap(Collection<Property> list) |
PropertiesMap(Map<String,Object> map) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Property property) |
void |
add(String key,
Object value) |
Map<String,Object> |
asMap() |
boolean |
equals(Object obj) |
reactor.core.publisher.Flux<Map.Entry<String,Object>> |
flux() |
<T> T |
get(String key,
T defaultValue)
Gets value of key if present and it the same right as default
|
int |
hashCode() |
boolean |
isEmpty() |
Stream<Map.Entry<String,Object>> |
stream() |
public PropertiesMap()
public PropertiesMap(Collection<Property> list)
public void add(Property property)
public boolean isEmpty()
public <T> T get(String key, T defaultValue)
T - the generic typekey - the keydefaultValue - (do not use null!_Copyright © 2017–2018 Committed. All rights reserved.