Class JsonUnflattenerFactory
- java.lang.Object
-
- com.github.wnameless.json.unflattener.JsonUnflattenerFactory
-
public final class JsonUnflattenerFactory extends Object
JsonUnflattenerFactorypreserves the configuration of aJsonUnflattener, in doing so, any input JSON data can be used to create aJsonUnflattenerobject with the same configuration.- Author:
- Wei-Ming Wu
-
-
Constructor Summary
Constructors Constructor Description JsonUnflattenerFactory(Consumer<JsonUnflattener> configurer)Returns aJsonUnflattenerFactory.JsonUnflattenerFactory(Consumer<JsonUnflattener> configurer, com.github.wnameless.json.base.JsonCore<?> jsonCore)Returns aJsonUnflattenerFactory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonUnflattenerbuild(Reader jsonReader)Creates aJsonUnflattenerby given JSON reader and configures it with the configurer and jsonCore within thisJsonUnflattenerFactory.JsonUnflattenerbuild(String json)Creates aJsonUnflattenerby given JSON string and configures it with the configurer and jsonCore within thisJsonUnflattenerFactory.JsonUnflattenerbuild(Map<String,?> flattenedMap)Creates aJsonUnflattenerby given flattenedMapand configures it with the configurer and jsonCore within thisJsonUnflattenerFactory.booleanequals(Object o)inthashCode()StringtoString()
-
-
-
Constructor Detail
-
JsonUnflattenerFactory
public JsonUnflattenerFactory(Consumer<JsonUnflattener> configurer)
Returns aJsonUnflattenerFactory.- Parameters:
configurer- a functional interface used to set up the configuration of aJsonUnflattener.
-
JsonUnflattenerFactory
public JsonUnflattenerFactory(Consumer<JsonUnflattener> configurer, com.github.wnameless.json.base.JsonCore<?> jsonCore)
Returns aJsonUnflattenerFactory.- Parameters:
configurer- a functional interface used to set up the configuration of aJsonUnflattener.jsonCore- aJsonCore
-
-
Method Detail
-
build
public JsonUnflattener build(String json)
Creates aJsonUnflattenerby given JSON string and configures it with the configurer and jsonCore within thisJsonUnflattenerFactory.- Parameters:
json- the JSON string- Returns:
- a
JsonUnflattener
-
build
public JsonUnflattener build(Map<String,?> flattenedMap)
Creates aJsonUnflattenerby given flattenedMapand configures it with the configurer and jsonCore within thisJsonUnflattenerFactory.- Parameters:
flattenedMap- a flattenedMap- Returns:
- a
JsonUnflattener
-
build
public JsonUnflattener build(Reader jsonReader) throws IOException
Creates aJsonUnflattenerby given JSON reader and configures it with the configurer and jsonCore within thisJsonUnflattenerFactory.- Parameters:
jsonReader- a JSON reader- Returns:
- a
JsonUnflattener - Throws:
IOException- if the jsonReader cannot be read
-
-