Class ImmutableTrees.IfStatement

    • Method Detail

      • withThen

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

        public final ImmutableTrees.IfStatement withOtherwiseIf​(java.lang.Iterable<? extends Trees.ConditionalBlock> elements)
        Copy the current immutable object with elements that replace the content of otherwiseIf. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of otherwiseIf elements to set
        Returns:
        A modified copy of this object
      • withOtherwise

        public final ImmutableTrees.IfStatement withOtherwise​(Trees.Block value)
        Copy the current immutable object by setting a present value for the optional otherwise attribute.
        Parameters:
        value - The value for otherwise
        Returns:
        A modified copy of this object
      • withOtherwise

        public final ImmutableTrees.IfStatement withOtherwise​(com.google.common.base.Optional<? extends Trees.Block> optional)
        Copy the current immutable object by setting an optional value for the otherwise 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 otherwise
        Returns:
        A modified copy of this object
      • equals

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

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

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

        public static ImmutableTrees.IfStatement.Builder builder()
        Creates a builder for IfStatement.
         ImmutableTrees.IfStatement.builder()
            .then(org.immutables.generator.processor.Trees.ConditionalBlock) // required then
            .addOtherwiseIf|addAllOtherwiseIf(org.immutables.generator.processor.Trees.ConditionalBlock) // otherwiseIf elements
            .otherwise(org.immutables.generator.processor.Trees.Block) // optional otherwise
            .build();
         
        Returns:
        A new IfStatement builder