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 java.lang.Object implements RepositoryModel.FacetImmutable implementation ofRepositoryModel.Facet.Use the builder to create immutable instances:
ImmutableFacet.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableFacet.BuilderBuilds instances of typeImmutableFacet.
-
Field Summary
Fields Modifier and Type Field Description private RepositoryModel.CodeBlockconstructorprivate javax.lang.model.type.TypeMirrorfieldTypeprivate javax.lang.model.type.TypeMirrorinterfaceTypeprivate com.google.common.collect.ImmutableList<RepositoryModel.DelegateMethod>methodsprivate java.lang.Stringname
-
Constructor Summary
Constructors Modifier Constructor Description privateImmutableFacet(java.lang.String name, javax.lang.model.type.TypeMirror interfaceType, javax.lang.model.type.TypeMirror fieldType, RepositoryModel.CodeBlock constructor, com.google.common.collect.ImmutableList<RepositoryModel.DelegateMethod> methods)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableFacet.Builderbuilder()Creates a builder forImmutableFacet.RepositoryModel.CodeBlockconstructor()static ImmutableFacetcopyOf(RepositoryModel.Facet instance)Creates an immutable copy of aRepositoryModel.Facetvalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofImmutableFacetthat have equal attribute values.private booleanequalTo(int synthetic, ImmutableFacet another)javax.lang.model.type.TypeMirrorfieldType()inthashCode()Computes a hash code from attributes:name,interfaceType,fieldType,constructor,methods.javax.lang.model.type.TypeMirrorinterfaceType()com.google.common.collect.ImmutableList<RepositoryModel.DelegateMethod>methods()java.lang.Stringname()java.lang.StringtoString()Prints the immutable valueFacetwith attribute values.ImmutableFacetwithConstructor(RepositoryModel.CodeBlock value)Copy the current immutable object by setting a value for theconstructorattribute.ImmutableFacetwithFieldType(javax.lang.model.type.TypeMirror value)Copy the current immutable object by setting a value for thefieldTypeattribute.ImmutableFacetwithInterfaceType(javax.lang.model.type.TypeMirror value)Copy the current immutable object by setting a value for theinterfaceTypeattribute.ImmutableFacetwithMethods(java.lang.Iterable<? extends RepositoryModel.DelegateMethod> elements)Copy the current immutable object with elements that replace the content ofmethods.ImmutableFacetwithMethods(RepositoryModel.DelegateMethod... elements)Copy the current immutable object with elements that replace the content ofmethods.ImmutableFacetwithName(java.lang.String value)Copy the current immutable object by setting a value for thenameattribute.
-
-
-
Field Detail
-
name
private final java.lang.String name
-
interfaceType
private final javax.lang.model.type.TypeMirror interfaceType
-
fieldType
private final javax.lang.model.type.TypeMirror fieldType
-
constructor
private final RepositoryModel.CodeBlock constructor
-
methods
private final com.google.common.collect.ImmutableList<RepositoryModel.DelegateMethod> methods
-
-
Constructor Detail
-
ImmutableFacet
private ImmutableFacet(java.lang.String name, javax.lang.model.type.TypeMirror interfaceType, javax.lang.model.type.TypeMirror fieldType, RepositoryModel.CodeBlock constructor, com.google.common.collect.ImmutableList<RepositoryModel.DelegateMethod> methods)
-
-
Method Detail
-
name
public java.lang.String name()
- Specified by:
namein interfaceRepositoryModel.Facet- Returns:
- The value of the
nameattribute
-
interfaceType
public javax.lang.model.type.TypeMirror interfaceType()
- Specified by:
interfaceTypein interfaceRepositoryModel.Facet- Returns:
- The value of the
interfaceTypeattribute
-
fieldType
public javax.lang.model.type.TypeMirror fieldType()
- Specified by:
fieldTypein interfaceRepositoryModel.Facet- Returns:
- The value of the
fieldTypeattribute
-
constructor
public RepositoryModel.CodeBlock constructor()
- Specified by:
constructorin interfaceRepositoryModel.Facet- Returns:
- The value of the
constructorattribute
-
methods
public com.google.common.collect.ImmutableList<RepositoryModel.DelegateMethod> methods()
- Specified by:
methodsin interfaceRepositoryModel.Facet- Returns:
- The value of the
methodsattribute
-
withName
public final ImmutableFacet 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
-
withInterfaceType
public final ImmutableFacet withInterfaceType(javax.lang.model.type.TypeMirror value)
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
public final ImmutableFacet withFieldType(javax.lang.model.type.TypeMirror value)
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
public final ImmutableFacet withConstructor(RepositoryModel.CodeBlock value)
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
public final ImmutableFacet withMethods(RepositoryModel.DelegateMethod... elements)
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(java.lang.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
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofImmutableFacetthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
equalTo
private boolean equalTo(int synthetic, ImmutableFacet another)
-
hashCode
public int hashCode()
Computes a hash code from attributes:name,interfaceType,fieldType,constructor,methods.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueFacetwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableFacet copyOf(RepositoryModel.Facet instance)
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
public static ImmutableFacet.Builder 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
-
-