Package net.dona.doip.util

# Class GsonUtility

java.lang.Object
net.dona.doip.util.GsonUtility

public class GsonUtility extends Object
A provider of `Gson` instances able to serialize instances of `Stream` (as arrays) and instances of `PublicKey` and `PrivateKey` (in JSON Web Key format).

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `GsonUtility.PrivateKeyTypeHierarchyAdapter`
  `static class`
  `GsonUtility.PublicKeyTypeHierarchyAdapter`
  `static class`
  `GsonUtility.StreamGsonTypeAdapter<T>`
  Serializing `Stream`s of objects in a streaming fashion, which will be useful for outputting extremely large search results.
  `static class`
  `GsonUtility.StreamTypeAdapterFactory`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GsonUtility()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static com.google.gson.Gson`
  `getGson()`
  Returns a `Gson` object.
  `static com.google.gson.Gson`
  `getPrettyGson()`
  Returns a `Gson` which is configured for pretty-printing.
  `static com.google.gson.GsonBuilder`
  `setup(com.google.gson.GsonBuilder gsonBuilder)`
  Sets up an instance of `GsonBuilder` to serialize streams and keys.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### GsonUtility

    public GsonUtility()

- ## Method Details

  - ### setup

    public static com.google.gson.GsonBuilder setup(com.google.gson.GsonBuilder gsonBuilder)
    Sets up an instance of `GsonBuilder` to serialize streams and keys.
    Parameters:
      `gsonBuilder` - the GsonBuilder
    Returns:
      an instance of `GsonBuilder` to serialize streams and keys

  - ### getGson

    public static com.google.gson.Gson getGson()
    Returns a `Gson` object.
    Returns:
      a `Gson` object

  - ### getPrettyGson

    public static com.google.gson.Gson getPrettyGson()
    Returns a `Gson` which is configured for pretty-printing.
    Returns:
      a Gson object which is configured for pretty-printing