Package org.immutables.value.processor
Class ImmutableTypeAdapterTypes
- java.lang.Object
-
- org.immutables.value.processor.ImmutableTypeAdapterTypes
-
- All Implemented Interfaces:
Gsons.TypeAdapterTypes
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ImmutableTypeAdapterTypes extends java.lang.Object implements Gsons.TypeAdapterTypesImmutable implementation ofGsons.TypeAdapterTypes.Use the builder to create immutable instances:
ImmutableTypeAdapterTypes.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableTypeAdapterTypes.BuilderBuilds instances of typeImmutableTypeAdapterTypes.
-
Field Summary
Fields Modifier and Type Field Description private Proto.AbstractDeclaringdefinedByprivate GsonMirrors.TypeAdaptersmirrorprivate java.lang.StringpackageGeneratedprivate com.google.common.collect.ImmutableList<ValueType>types
-
Constructor Summary
Constructors Modifier Constructor Description privateImmutableTypeAdapterTypes(Proto.AbstractDeclaring definedBy, java.lang.String packageGenerated, com.google.common.collect.ImmutableList<ValueType> types, GsonMirrors.TypeAdapters mirror)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableTypeAdapterTypes.Builderbuilder()Creates a builder forImmutableTypeAdapterTypes.static ImmutableTypeAdapterTypescopyOf(Gsons.TypeAdapterTypes instance)Creates an immutable copy of aGsons.TypeAdapterTypesvalue.Proto.AbstractDeclaringdefinedBy()booleanequals(java.lang.Object another)This instance is equal to all instances ofImmutableTypeAdapterTypesthat have equal attribute values.private booleanequalTo(int synthetic, ImmutableTypeAdapterTypes another)inthashCode()Computes a hash code from attributes:definedBy,packageGenerated,types,mirror.GsonMirrors.TypeAdaptersmirror()java.lang.StringpackageGenerated()java.lang.StringtoString()Prints the immutable valueTypeAdapterTypeswith attribute values.com.google.common.collect.ImmutableList<ValueType>types()ImmutableTypeAdapterTypeswithDefinedBy(Proto.AbstractDeclaring value)Copy the current immutable object by setting a value for thedefinedByattribute.ImmutableTypeAdapterTypeswithMirror(GsonMirrors.TypeAdapters value)Copy the current immutable object by setting a value for themirrorattribute.ImmutableTypeAdapterTypeswithPackageGenerated(java.lang.String value)Copy the current immutable object by setting a value for thepackageGeneratedattribute.ImmutableTypeAdapterTypeswithTypes(java.lang.Iterable<? extends ValueType> elements)Copy the current immutable object with elements that replace the content oftypes.ImmutableTypeAdapterTypeswithTypes(ValueType... elements)Copy the current immutable object with elements that replace the content oftypes.
-
-
-
Field Detail
-
definedBy
private final Proto.AbstractDeclaring definedBy
-
packageGenerated
private final java.lang.String packageGenerated
-
types
private final com.google.common.collect.ImmutableList<ValueType> types
-
mirror
private final GsonMirrors.TypeAdapters mirror
-
-
Constructor Detail
-
ImmutableTypeAdapterTypes
private ImmutableTypeAdapterTypes(Proto.AbstractDeclaring definedBy, java.lang.String packageGenerated, com.google.common.collect.ImmutableList<ValueType> types, GsonMirrors.TypeAdapters mirror)
-
-
Method Detail
-
definedBy
public Proto.AbstractDeclaring definedBy()
- Specified by:
definedByin interfaceGsons.TypeAdapterTypes- Returns:
- The value of the
definedByattribute
-
packageGenerated
public java.lang.String packageGenerated()
- Specified by:
packageGeneratedin interfaceGsons.TypeAdapterTypes- Returns:
- The value of the
packageGeneratedattribute
-
types
public com.google.common.collect.ImmutableList<ValueType> types()
- Specified by:
typesin interfaceGsons.TypeAdapterTypes- Returns:
- The value of the
typesattribute
-
mirror
public GsonMirrors.TypeAdapters mirror()
- Specified by:
mirrorin interfaceGsons.TypeAdapterTypes- Returns:
- The value of the
mirrorattribute
-
withDefinedBy
public final ImmutableTypeAdapterTypes withDefinedBy(Proto.AbstractDeclaring value)
Copy the current immutable object by setting a value for thedefinedByattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for definedBy- Returns:
- A modified copy of the
thisobject
-
withPackageGenerated
public final ImmutableTypeAdapterTypes withPackageGenerated(java.lang.String value)
Copy the current immutable object by setting a value for thepackageGeneratedattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for packageGenerated- Returns:
- A modified copy of the
thisobject
-
withTypes
public final ImmutableTypeAdapterTypes withTypes(ValueType... elements)
Copy the current immutable object with elements that replace the content oftypes.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withTypes
public final ImmutableTypeAdapterTypes withTypes(java.lang.Iterable<? extends ValueType> elements)
Copy the current immutable object with elements that replace the content oftypes. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of types elements to set- Returns:
- A modified copy of
thisobject
-
withMirror
public final ImmutableTypeAdapterTypes withMirror(GsonMirrors.TypeAdapters value)
Copy the current immutable object by setting a value for themirrorattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for mirror- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutableTypeAdapterTypesthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
equalTo
private boolean equalTo(int synthetic, ImmutableTypeAdapterTypes another)
-
hashCode
public int hashCode()
Computes a hash code from attributes:definedBy,packageGenerated,types,mirror.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueTypeAdapterTypeswith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableTypeAdapterTypes copyOf(Gsons.TypeAdapterTypes instance)
Creates an immutable copy of aGsons.TypeAdapterTypesvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable TypeAdapterTypes instance
-
builder
public static ImmutableTypeAdapterTypes.Builder builder()
Creates a builder forImmutableTypeAdapterTypes.ImmutableTypeAdapterTypes.builder() .definedBy(org.immutables.value.processor.meta.Proto.AbstractDeclaring) // requireddefinedBy.packageGenerated(String) // requiredpackageGenerated.addTypes|addAllTypes(org.immutables.value.processor.meta.ValueType) //typeselements .mirror(org.immutables.value.processor.meta.GsonMirrors.TypeAdapters) // requiredmirror.build();- Returns:
- A new ImmutableTypeAdapterTypes builder
-
-