Class ImmutableFacet
java.lang.Object
org.immutables.value.processor.meta.ImmutableFacet
- All Implemented Interfaces:
RepositoryModel.Facet
@ParametersAreNonnullByDefault
@Generated("org.immutables.processor.ProxyProcessor")
@Immutable
public final class ImmutableFacet
extends Object
implements RepositoryModel.Facet
Immutable implementation of
RepositoryModel.Facet.
Use the builder to create immutable instances:
ImmutableFacet.builder().
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final RepositoryModel.CodeBlockprivate final TypeMirrorprivate final TypeMirrorprivate final com.google.common.collect.ImmutableList<RepositoryModel.DelegateMethod> private final String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateImmutableFacet(String name, TypeMirror interfaceType, TypeMirror fieldType, RepositoryModel.CodeBlock constructor, com.google.common.collect.ImmutableList<RepositoryModel.DelegateMethod> methods) -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableFacet.Builderbuilder()Creates a builder forImmutableFacet.static ImmutableFacetcopyOf(RepositoryModel.Facet instance) Creates an immutable copy of aRepositoryModel.Facetvalue.booleanThis instance is equal to all instances ofImmutableFacetthat have equal attribute values.private booleanequalTo(int synthetic, ImmutableFacet another) inthashCode()Computes a hash code from attributes:name,interfaceType,fieldType,constructor,methods.com.google.common.collect.ImmutableList<RepositoryModel.DelegateMethod> methods()name()toString()Prints the immutable valueFacetwith attribute values.final ImmutableFacetCopy the current immutable object by setting a value for theconstructorattribute.final ImmutableFacetwithFieldType(TypeMirror value) Copy the current immutable object by setting a value for thefieldTypeattribute.final ImmutableFacetwithInterfaceType(TypeMirror value) Copy the current immutable object by setting a value for theinterfaceTypeattribute.final ImmutableFacetwithMethods(Iterable<? extends RepositoryModel.DelegateMethod> elements) Copy the current immutable object with elements that replace the content ofmethods.final ImmutableFacetwithMethods(RepositoryModel.DelegateMethod... elements) Copy the current immutable object with elements that replace the content ofmethods.final ImmutableFacetCopy the current immutable object by setting a value for thenameattribute.
-
Field Details
-
name
-
interfaceType
-
fieldType
-
constructor
-
methods
-
-
Constructor Details
-
ImmutableFacet
private ImmutableFacet(String name, TypeMirror interfaceType, TypeMirror fieldType, RepositoryModel.CodeBlock constructor, com.google.common.collect.ImmutableList<RepositoryModel.DelegateMethod> methods)
-
-
Method Details
-
name
- Specified by:
namein interfaceRepositoryModel.Facet- Returns:
- The value of the
nameattribute
-
interfaceType
- Specified by:
interfaceTypein interfaceRepositoryModel.Facet- Returns:
- The value of the
interfaceTypeattribute
-
fieldType
- Specified by:
fieldTypein interfaceRepositoryModel.Facet- Returns:
- The value of the
fieldTypeattribute
-
constructor
- Specified by:
constructorin interfaceRepositoryModel.Facet- Returns:
- The value of the
constructorattribute
-
methods
- Specified by:
methodsin interfaceRepositoryModel.Facet- Returns:
- The value of the
methodsattribute
-
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
-
withInterfaceType
Copy the current immutable object by setting a value for theinterfaceTypeattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for interfaceType- Returns:
- A modified copy of the
thisobject
-
withFieldType
Copy the current immutable object by setting a value for thefieldTypeattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for fieldType- Returns:
- A modified copy of the
thisobject
-
withConstructor
Copy the current immutable object by setting a value for theconstructorattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for constructor- Returns:
- A modified copy of the
thisobject
-
withMethods
Copy the current immutable object with elements that replace the content ofmethods.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withMethods
public final ImmutableFacet withMethods(Iterable<? extends RepositoryModel.DelegateMethod> elements) Copy the current immutable object with elements that replace the content ofmethods. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of methods elements to set- Returns:
- A modified copy of
thisobject
-
equals
This instance is equal to all instances ofImmutableFacetthat have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:name,interfaceType,fieldType,constructor,methods. -
toString
Prints the immutable valueFacetwith attribute values. -
copyOf
Creates an immutable copy of aRepositoryModel.Facetvalue. 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 Facet instance
-
builder
Creates a builder forImmutableFacet.ImmutableFacet.builder() .name(String) // requiredname.interfaceType(javax.lang.model.type.TypeMirror) // requiredinterfaceType.fieldType(javax.lang.model.type.TypeMirror) // requiredfieldType.constructor(org.immutables.value.processor.meta.RepositoryModel.CodeBlock) // requiredconstructor.addMethods|addAllMethods(org.immutables.value.processor.meta.RepositoryModel.DelegateMethod) //methodselements .build();- Returns:
- A new ImmutableFacet builder
-