org.immutables.fixture.nullable.GsonAdaptersNullableCompact Maven / Gradle / Ivy
package org.immutables.fixture.nullable;
import com.google.gson.*;
import com.google.gson.reflect.*;
import com.google.gson.stream.*;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.annotation.Generated;
import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;
/**
* A {@code TypeAdapterFactory} that handles all of the immutable types generated under {@code NullableCompact}.
* @see ImmutableNullableCompact
*/
@SuppressWarnings("all")
@Generated({"Gsons.generator", "org.immutables.fixture.nullable.NullableCompact"})
@ParametersAreNonnullByDefault
public final class GsonAdaptersNullableCompact implements TypeAdapterFactory {
@SuppressWarnings({"unchecked", "raw"}) // safe unchecked, types are verified in runtime
@Override
public TypeAdapter create(Gson gson, TypeToken type) {
if (NullableCompactTypeAdapter.adapts(type)) {
return (TypeAdapter) new NullableCompactTypeAdapter(gson);
}
return null;
}
@Override
public String toString() {
return "GsonAdaptersNullableCompact(NullableCompact)";
}
@SuppressWarnings({"unchecked", "raw"}) // safe unchecked, types are verified in runtime
private static class NullableCompactTypeAdapter extends TypeAdapter {
private final Integer arrayTypeSample = null;
private final Object mapSecondaryTypeSample = null;
private final TypeAdapter arrayTypeAdapter;
private final TypeAdapter
© 2015 - 2025 Weber Informatics LLC | Privacy Policy