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().

  • Field Details

  • Constructor Details

  • Method Details

    • name

      public String name()
      Specified by:
      name in interface RepositoryModel.Facet
      Returns:
      The value of the name attribute
    • interfaceType

      public TypeMirror interfaceType()
      Specified by:
      interfaceType in interface RepositoryModel.Facet
      Returns:
      The value of the interfaceType attribute
    • fieldType

      public TypeMirror fieldType()
      Specified by:
      fieldType in interface RepositoryModel.Facet
      Returns:
      The value of the fieldType attribute
    • constructor

      public RepositoryModel.CodeBlock constructor()
      Specified by:
      constructor in interface RepositoryModel.Facet
      Returns:
      The value of the constructor attribute
    • methods

      public com.google.common.collect.ImmutableList<RepositoryModel.DelegateMethod> methods()
      Specified by:
      methods in interface RepositoryModel.Facet
      Returns:
      The value of the methods attribute
    • withName

      public final ImmutableFacet withName(String value)
      Copy the current immutable object by setting a value for the name attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for name
      Returns:
      A modified copy of the this object
    • withInterfaceType

      public final ImmutableFacet withInterfaceType(TypeMirror value)
      Copy the current immutable object by setting a value for the interfaceType attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for interfaceType
      Returns:
      A modified copy of the this object
    • withFieldType

      public final ImmutableFacet withFieldType(TypeMirror value)
      Copy the current immutable object by setting a value for the fieldType attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for fieldType
      Returns:
      A modified copy of the this object
    • withConstructor

      public final ImmutableFacet withConstructor(RepositoryModel.CodeBlock value)
      Copy the current immutable object by setting a value for the constructor attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for constructor
      Returns:
      A modified copy of the this object
    • withMethods

      public final ImmutableFacet withMethods(RepositoryModel.DelegateMethod... elements)
      Copy the current immutable object with elements that replace the content of methods.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withMethods

      public final ImmutableFacet withMethods(Iterable<? extends RepositoryModel.DelegateMethod> elements)
      Copy the current immutable object with elements that replace the content of methods. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of methods elements to set
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableFacet that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • equalTo

      private boolean equalTo(int synthetic, ImmutableFacet another)
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: name, interfaceType, fieldType, constructor, methods.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value Facet with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ImmutableFacet copyOf(RepositoryModel.Facet instance)
      Creates an immutable copy of a RepositoryModel.Facet value. 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 for ImmutableFacet.
       ImmutableFacet.builder()
          .name(String) // required name
          .interfaceType(javax.lang.model.type.TypeMirror) // required interfaceType
          .fieldType(javax.lang.model.type.TypeMirror) // required fieldType
          .constructor(org.immutables.value.processor.meta.RepositoryModel.CodeBlock) // required constructor
          .addMethods|addAllMethods(org.immutables.value.processor.meta.RepositoryModel.DelegateMethod) // methods elements
          .build();
       
      Returns:
      A new ImmutableFacet builder