Class ImmutableEncodedElement.TypeParam
- java.lang.Object
-
- org.immutables.value.processor.encode.EncodedElement.TypeParam
-
- org.immutables.value.processor.encode.ImmutableEncodedElement.TypeParam
-
- Enclosing class:
- ImmutableEncodedElement
@Immutable static final class ImmutableEncodedElement.TypeParam extends EncodedElement.TypeParam
Immutable implementation ofEncodedElement.TypeParam.Use the builder to create immutable instances:
new EncodedElement.TypeParam.Builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableEncodedElement.TypeParam.BuilderBuilds instances of typeTypeParam.
-
Field Summary
Fields Modifier and Type Field Description private com.google.common.collect.ImmutableList<Type.Defined>boundsprivate java.lang.Stringname
-
Constructor Summary
Constructors Modifier Constructor Description privateTypeParam(java.lang.String name, com.google.common.collect.ImmutableList<Type.Defined> bounds)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) com.google.common.collect.ImmutableList<Type.Defined>bounds()static EncodedElement.TypeParamcopyOf(EncodedElement.TypeParam instance)Creates an immutable copy of aEncodedElement.TypeParamvalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofTypeParamthat have equal attribute values.private booleanequalTo(int synthetic, ImmutableEncodedElement.TypeParam another)inthashCode()Computes a hash code from attributes:name,bounds.(package private) java.lang.Stringname()ImmutableEncodedElement.TypeParamwithBounds(java.lang.Iterable<? extends Type.Defined> elements)Copy the current immutable object with elements that replace the content ofbounds.ImmutableEncodedElement.TypeParamwithBounds(Type.Defined... elements)Copy the current immutable object with elements that replace the content ofbounds.ImmutableEncodedElement.TypeParamwithName(java.lang.String value)Copy the current immutable object by setting a value for thenameattribute.-
Methods inherited from class org.immutables.value.processor.encode.EncodedElement.TypeParam
from, toString
-
-
-
-
Field Detail
-
name
private final java.lang.String name
-
bounds
private final com.google.common.collect.ImmutableList<Type.Defined> bounds
-
-
Constructor Detail
-
TypeParam
private TypeParam(java.lang.String name, com.google.common.collect.ImmutableList<Type.Defined> bounds)
-
-
Method Detail
-
name
java.lang.String name()
- Specified by:
namein classEncodedElement.TypeParam- Returns:
- The value of the
nameattribute
-
bounds
com.google.common.collect.ImmutableList<Type.Defined> bounds()
- Specified by:
boundsin classEncodedElement.TypeParam- Returns:
- The value of the
boundsattribute
-
withName
public final ImmutableEncodedElement.TypeParam withName(java.lang.String value)
Copy the current immutable object by setting a value for thenameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for name- Returns:
- A modified copy of the
thisobject
-
withBounds
public final ImmutableEncodedElement.TypeParam withBounds(Type.Defined... elements)
Copy the current immutable object with elements that replace the content ofbounds.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withBounds
public final ImmutableEncodedElement.TypeParam withBounds(java.lang.Iterable<? extends Type.Defined> elements)
Copy the current immutable object with elements that replace the content ofbounds. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of bounds elements to set- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofTypeParamthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
equalTo
private boolean equalTo(int synthetic, ImmutableEncodedElement.TypeParam another)
-
hashCode
public int hashCode()
Computes a hash code from attributes:name,bounds.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
copyOf
public static EncodedElement.TypeParam copyOf(EncodedElement.TypeParam instance)
Creates an immutable copy of aEncodedElement.TypeParamvalue. 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 TypeParam instance
-
-