Package org.bremersee.geojson.model
Class UnknownAware
java.lang.Object
org.bremersee.geojson.model.UnknownAware
- Direct Known Subclasses:
GeoJsonFeature,GeoJsonFeatureCollection
This base class stores unknown json properties.
- Author:
- Christian Bremer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> Optional<T> findUnknown(String jsonPath, Class<T> clazz) Find a value from the unknown map.findUnknownList(String jsonPath, Class<E> clazz) Find a list from the unknown map.findUnknownMap(String jsonPath) Find a map / json object from the unknown map.booleanReturnstrueif there are unknown properties, otherwisefalse.unknown()Gets the unknown json properties (can benull).voidAny json setter.voidSets the unknown json properties.
-
Constructor Details
-
UnknownAware
public UnknownAware()
-
-
Method Details
-
unknown
Gets the unknown json properties (can benull).- Returns:
- the unknown
-
unknown
Sets the unknown json properties.- Parameters:
unknown- the unknown json properties
-
unknown
Any json setter.- Parameters:
name- the namevalue- the value
-
hasUnknown
public boolean hasUnknown()Returnstrueif there are unknown properties, otherwisefalse.- Returns:
trueif there are unknown properties, otherwisefalse
-
findUnknown
Find a value from the unknown map.- Type Parameters:
T- the class type- Parameters:
jsonPath- the json path, e. g.$.firstKey.secondKey.thirdKeyclazz- the expected result class- Returns:
- an empty optional if the value was not found or can not be casted, otherwise the value
-
findUnknownList
Find a list from the unknown map.- Type Parameters:
E- the list element type- Parameters:
jsonPath- the json path, e. g.$.firstKey.secondKey.thirdKeyclazz- the list element type- Returns:
- an empty optional if the list was not found or can not be casted, otherwise the list
-
findUnknownMap
Find a map / json object from the unknown map.- Parameters:
jsonPath- the json path, e. g.$.firstKey.secondKey.thirdKey- Returns:
- an empty optional if the map / json object was not found or can not be cast, otherwise the map / json object
-