Class ImmutableTrees.TypeDeclaration

    • Method Detail

      • withType

        public final ImmutableTrees.TypeDeclaration withType​(Trees.TypeIdentifier value)
        Copy the current immutable object by setting a value for the type attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for type
        Returns:
        A modified copy of the this object
      • withKind

        public final ImmutableTrees.TypeDeclaration withKind​(Trees.TypeDeclaration.Kind value)
        Copy the current immutable object by setting a value for the kind attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for kind
        Returns:
        A modified copy of the this object
      • equals

        public boolean equals​(@Nullable
                              java.lang.Object another)
        This instance is equal to all instances of TypeDeclaration 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: type, kind.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hashCode value
      • toString

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

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

        public static ImmutableTrees.TypeDeclaration.Builder builder()
        Creates a builder for TypeDeclaration.
         ImmutableTrees.TypeDeclaration.builder()
            .type(org.immutables.generator.processor.Trees.TypeIdentifier) // required type
            .kind(org.immutables.generator.processor.Trees.TypeDeclaration.Kind) // optional kind
            .build();
         
        Returns:
        A new TypeDeclaration builder