Class ImmutableEncodedElement.Param
java.lang.Object
org.immutables.value.processor.encode.EncodedElement.Param
org.immutables.value.processor.encode.ImmutableEncodedElement.Param
- Enclosing class:
ImmutableEncodedElement
Immutable implementation of
EncodedElement.Param.
Use the static factory method to create immutable instances:
ImmutableEncodedElement.Param.of().
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) com.google.common.collect.ImmutableList<String> static EncodedElement.ParamcopyOf(EncodedElement.Param instance) Creates an immutable copy of aEncodedElement.Paramvalue.booleanThis 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) Stringname()static EncodedElement.ParamConstruct a new immutableParaminstance.static EncodedElement.ParamConstruct a new immutableParaminstance.(package private) Typetype()withAnnotations(Iterable<String> elements) Copy the current immutable object with elements that replace the content ofannotations.withAnnotations(String... elements) Copy the current immutable object with elements that replace the content ofannotations.Copy the current immutable object by setting a value for thenameattribute.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 Details
-
name
-
type
-
annotations
-
-
Constructor Details
-
Param
-
Param
private Param(ImmutableEncodedElement.Param original, String name, Type type, com.google.common.collect.ImmutableList<String> annotations)
-
-
Method Details
-
name
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<String> annotations()- Specified by:
annotationsin classEncodedElement.Param- Returns:
- The value of the
annotationsattribute
-
withName
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
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
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
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
This instance is equal to all instances ofParamthat have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:name,type,annotations. -
of
Construct a new immutableParaminstance.- Parameters:
name- The value for thenameattributetype- The value for thetypeattributeannotations- The value for theannotationsattribute- Returns:
- An immutable Param instance
-
of
Construct a new immutableParaminstance.- Parameters:
name- The value for thenameattributetype- The value for thetypeattributeannotations- The value for theannotationsattribute- Returns:
- An immutable Param instance
-
copyOf
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
-