Class ImmutableTrees.ValueDeclaration

    • Method Detail

      • withName

        public final ImmutableTrees.ValueDeclaration withName​(Trees.Identifier value)
        Copy the current immutable object by setting a value for the name attribute. A shallow reference equality check is 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
      • withType

        public final ImmutableTrees.ValueDeclaration withType​(com.google.common.base.Optional<? extends Trees.TypeReference> optional)
        Copy the current immutable object by setting an optional value for the type attribute. A shallow reference equality check on the optional value is used to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for type
        Returns:
        A modified copy of this object
      • withContainedType

        public final ImmutableTrees.ValueDeclaration withContainedType​(com.google.common.base.Optional<? extends Trees.TypeReference> optional)
        Copy the current immutable object by setting an optional value for the containedType attribute. A shallow reference equality check on the optional value is used to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for containedType
        Returns:
        A modified copy of this object
      • equals

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

        public int hashCode()
        Computes a hash code from attributes: name, type, containedType.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hashCode value
      • toString

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

        public static ImmutableTrees.ValueDeclaration copyOf​(Trees.ValueDeclaration instance)
        Creates an immutable copy of a Trees.ValueDeclaration 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 ValueDeclaration instance
      • builder

        public static ImmutableTrees.ValueDeclaration.Builder builder()
        Creates a builder for ValueDeclaration.
         ImmutableTrees.ValueDeclaration.builder()
            .name(org.immutables.generator.processor.Trees.Identifier) // required name
            .type(org.immutables.generator.processor.Trees.TypeReference) // optional type
            .containedType(org.immutables.generator.processor.Trees.TypeReference) // optional containedType
            .build();
         
        Returns:
        A new ValueDeclaration builder