Class ImmutableEncodedElement.Param
- java.lang.Object
-
- org.immutables.value.processor.encode.EncodedElement.Param
-
- org.immutables.value.processor.encode.ImmutableEncodedElement.Param
-
- Enclosing class:
- ImmutableEncodedElement
@Immutable static final class ImmutableEncodedElement.Param extends EncodedElement.Param
Immutable implementation ofEncodedElement.Param.Use the static factory method to create immutable instances:
ImmutableEncodedElement.Param.of().
-
-
Field Summary
Fields Modifier and Type Field Description private com.google.common.collect.ImmutableList<java.lang.String>annotationsprivate java.lang.Stringnameprivate Typetype
-
Constructor Summary
Constructors Modifier Constructor Description privateParam(java.lang.String name, Type type, java.lang.Iterable<java.lang.String> annotations)privateParam(ImmutableEncodedElement.Param original, java.lang.String name, Type type, com.google.common.collect.ImmutableList<java.lang.String> annotations)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) com.google.common.collect.ImmutableList<java.lang.String>annotations()static EncodedElement.ParamcopyOf(EncodedElement.Param instance)Creates an immutable copy of aEncodedElement.Paramvalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofParamthat have equal attribute values.private booleanequalTo(int synthetic, ImmutableEncodedElement.Param another)inthashCode()Computes a hash code from attributes:name,type,annotations.(package private) java.lang.Stringname()static EncodedElement.Paramof(java.lang.String name, Type type, java.lang.Iterable<java.lang.String> annotations)Construct a new immutableParaminstance.static EncodedElement.Paramof(java.lang.String name, Type type, java.util.List<java.lang.String> annotations)Construct a new immutableParaminstance.(package private) Typetype()ImmutableEncodedElement.ParamwithAnnotations(java.lang.Iterable<java.lang.String> elements)Copy the current immutable object with elements that replace the content ofannotations.ImmutableEncodedElement.ParamwithAnnotations(java.lang.String... elements)Copy the current immutable object with elements that replace the content ofannotations.ImmutableEncodedElement.ParamwithName(java.lang.String value)Copy the current immutable object by setting a value for thenameattribute.ImmutableEncodedElement.ParamwithType(Type value)Copy the current immutable object by setting a value for thetypeattribute.-
Methods inherited from class org.immutables.value.processor.encode.EncodedElement.Param
from, of, toString
-
-
-
-
Field Detail
-
name
private final java.lang.String name
-
type
private final Type type
-
annotations
private final com.google.common.collect.ImmutableList<java.lang.String> annotations
-
-
Constructor Detail
-
Param
private Param(java.lang.String name, Type type, java.lang.Iterable<java.lang.String> annotations)
-
Param
private Param(ImmutableEncodedElement.Param original, java.lang.String name, Type type, com.google.common.collect.ImmutableList<java.lang.String> annotations)
-
-
Method Detail
-
name
java.lang.String name()
- Specified by:
namein classEncodedElement.Param- Returns:
- The value of the
nameattribute
-
type
Type type()
- Specified by:
typein classEncodedElement.Param- Returns:
- The value of the
typeattribute
-
annotations
com.google.common.collect.ImmutableList<java.lang.String> annotations()
- Specified by:
annotationsin classEncodedElement.Param- Returns:
- The value of the
annotationsattribute
-
withName
public final ImmutableEncodedElement.Param 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
-
withType
public final ImmutableEncodedElement.Param withType(Type value)
Copy the current immutable object by setting a value for thetypeattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for type- Returns:
- A modified copy of the
thisobject
-
withAnnotations
public final ImmutableEncodedElement.Param withAnnotations(java.lang.String... elements)
Copy the current immutable object with elements that replace the content ofannotations.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withAnnotations
public final ImmutableEncodedElement.Param withAnnotations(java.lang.Iterable<java.lang.String> elements)
Copy the current immutable object with elements that replace the content ofannotations. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of annotations 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 ofParamthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
equalTo
private boolean equalTo(int synthetic, ImmutableEncodedElement.Param another)
-
hashCode
public int hashCode()
Computes a hash code from attributes:name,type,annotations.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
of
public static EncodedElement.Param of(java.lang.String name, Type type, java.util.List<java.lang.String> annotations)
Construct a new immutableParaminstance.- Parameters:
name- The value for thenameattributetype- The value for thetypeattributeannotations- The value for theannotationsattribute- Returns:
- An immutable Param instance
-
of
public static EncodedElement.Param of(java.lang.String name, Type type, java.lang.Iterable<java.lang.String> annotations)
Construct a new immutableParaminstance.- Parameters:
name- The value for thenameattributetype- The value for thetypeattributeannotations- The value for theannotationsattribute- Returns:
- An immutable Param instance
-
copyOf
public static EncodedElement.Param copyOf(EncodedElement.Param instance)
Creates an immutable copy of aEncodedElement.Paramvalue. 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 Param instance
-
-