org.immutables.fixture.nullable.GsonAdaptersNullableCompact Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of value-fixture Show documentation
Show all versions of value-fixture Show documentation
Module that contains all tests for the code generation capability
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.Collections;
import java.util.List;
import java.util.Map;
import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;
import javax.annotation.processing.Generated;
/**
* A {@code TypeAdapterFactory} that handles all of the immutable types generated under {@code NullableCompact}.
* @see ImmutableNullableCompact
*/
@SuppressWarnings({"all", "MethodCanBeStatic"})
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@org.immutables.value.Generated(from = "org.immutables.fixture.nullable", generator = "Gsons")
public final class GsonAdaptersNullableCompact implements TypeAdapterFactory {
@SuppressWarnings({"unchecked", "rawtypes"}) // 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)";
}
@org.immutables.value.Generated(from = "NullableCompact", generator = "Gsons")
@SuppressWarnings({"unchecked", "rawtypes"}) // safe unchecked, types are verified in runtime
private static class NullableCompactTypeAdapter extends TypeAdapter {
public final Integer arrayTypeSample = null;
public final Object mapSecondaryTypeSample = null;
private final TypeAdapter arrayTypeAdapter;
private final TypeAdapter