package ru.dbotthepony.kstarbound.json.builder

import com.google.gson.TypeAdapter
import com.google.gson.stream.JsonReader
import com.google.gson.stream.JsonWriter

class SingletonTypeAdapter<V>(val instance: V) : TypeAdapter<V>() {
	override fun write(out: JsonWriter, value: V) {
		out.nullValue()
	}

	override fun read(`in`: JsonReader): V {
		return instance
	}
}
