All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.dslplatform.json.runtime.AttributeDecoder Maven / Gradle / Ivy

There is a newer version: 1.10.0
Show newest version
package com.dslplatform.json.runtime;

import com.dslplatform.json.JsonReader;

import java.io.IOException;

class AttributeDecoder implements JsonReader.BindObject {

	private final Settings.BiConsumer write;
	private final JsonReader.ReadObject

decoder; AttributeDecoder( final Settings.BiConsumer write, final JsonReader.ReadObject

decoder) { if (write == null) throw new IllegalArgumentException("write can't be null"); if (decoder == null) throw new IllegalArgumentException("decoder can't be null"); this.write = write; this.decoder = decoder; } @Override public T bind(final JsonReader reader, final T instance) throws IOException { final P attr = decoder.read(reader); write.accept(instance, attr); return instance; } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy