Class StringBaseTypeAdapter<T>

java.lang.Object
com.google.gson.TypeAdapter<T>
google.registry.util.StringBaseTypeAdapter<T>
Direct Known Subclasses:
CidrAddressBlock.CidrAddressBlockAdapter, CurrencyJsonAdapter, DateTimeTypeAdapter, SerializableJsonTypeAdapter

public abstract class StringBaseTypeAdapter<T> extends com.google.gson.TypeAdapter<T>
Abstract class for TypeAdapters that can convert directly to/from strings.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract T
    fromString(String stringValue)
     
    read(com.google.gson.stream.JsonReader reader)
     
    void
    write(com.google.gson.stream.JsonWriter writer, T t)
     

    Methods inherited from class com.google.gson.TypeAdapter

    fromJson, fromJson, fromJsonTree, nullSafe, toJson, toJson, toJsonTree

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • StringBaseTypeAdapter

      public StringBaseTypeAdapter()
  • Method Details

    • read

      public T read(com.google.gson.stream.JsonReader reader) throws IOException
      Specified by:
      read in class com.google.gson.TypeAdapter<T>
      Throws:
      IOException
    • write

      public void write(com.google.gson.stream.JsonWriter writer, T t) throws IOException
      Specified by:
      write in class com.google.gson.TypeAdapter<T>
      Throws:
      IOException
    • fromString

      protected abstract T fromString(String stringValue) throws IOException
      Throws:
      IOException