Class ImmutableFacet

  • All Implemented Interfaces:
    RepositoryModel.Facet

    @ParametersAreNonnullByDefault
    @Generated("org.immutables.processor.ProxyProcessor")
    @Immutable
    public final class ImmutableFacet
    extends java.lang.Object
    implements RepositoryModel.Facet
    Immutable implementation of RepositoryModel.Facet.

    Use the builder to create immutable instances: ImmutableFacet.builder().

    • 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 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:
        name in interface RepositoryModel.Facet
        Returns:
        The value of the name attribute
      • interfaceType

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

        public javax.lang.model.type.TypeMirror fieldType()
        Specified by:
        fieldType in interface RepositoryModel.Facet
        Returns:
        The value of the fieldType attribute
      • withName

        public final ImmutableFacet withName​(java.lang.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​(javax.lang.model.type.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​(javax.lang.model.type.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​(java.lang.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
                              java.lang.Object another)
        This instance is equal to all instances of ImmutableFacet that have equal attribute values.
        Overrides:
        equals in class java.lang.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 java.lang.Object
        Returns:
        hashCode value
      • toString

        public java.lang.String toString()
        Prints the immutable value Facet with attribute values.
        Overrides:
        toString in class java.lang.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