import "copyrightAndOthers.stg"

targetPath() ::= "org/eclipse/collections/api/factory/bag/primitive"

fileName(primitive) ::= "Mutable<primitive.name>BagFactory"

class(primitive) ::= <<
<body(primitive.type, primitive.name, primitive.wrapperName)>
>>

body(type, name, wrapperName) ::= <<
<copyrightAndOthers()>

package org.eclipse.collections.api.factory.bag.primitive;

import org.eclipse.collections.api.<name>Iterable;
import org.eclipse.collections.api.bag.primitive.Mutable<name>Bag;
<(wideStreamImport.(type))>

/**
 * A factory which creates instances of type {@link Mutable<name>Bag}.
 * This file was automatically generated from template file mutablePrimitiveBagFactory.stg.
 *
 * @since 6.0.
 */
public interface Mutable<name>BagFactory
{
    Mutable<name>Bag empty();

    /**
     * Same as {@link #empty()}.
     */
    Mutable<name>Bag of();

    /**
     * Same as {@link #empty()}.
     */
    Mutable<name>Bag with();

    /**
     * Same as {@link #with(<type>[])}.
     */
    Mutable<name>Bag of(<type>... items);

    Mutable<name>Bag with(<type>... items);

    /**
     * Same as {@link #withAll(<name>Iterable)}.
     */
    Mutable<name>Bag ofAll(<name>Iterable items);

    Mutable<name>Bag withAll(<name>Iterable items);

    /**
     * Same as {@link #withAll(Iterable)}.
     */
    Mutable<name>Bag ofAll(Iterable\<<wrapperName>\> iterable);

    Mutable<name>Bag withAll(Iterable\<<wrapperName>\> iterable);
    <(streamMethods.(type))()>
}

>>

streamMethods ::= [
    "byte": "noMethods",
    "short": "noMethods",
    "char": "noMethods",
    "int": "allMethods",
    "long": "allMethods",
    "float": "noMethods",
    "double": "allMethods",
    "boolean": "noMethods"
    ]

allMethods() ::= <<

/**
 * @since 9.0
 */
Mutable<name>Bag ofAll(<(wideStream.(type))> items);

/**
 * @since 9.0
 */
Mutable<name>Bag withAll(<(wideStream.(type))> items);
>>

noMethods() ::= ""

wideStream ::= [
    "int": "IntStream",
    "long": "LongStream",
    "double": "DoubleStream",
    default: "no matching wide type"
]

wideStreamImport ::= [
    "boolean": "",
    "byte": "",
    "short": "",
    "char": "",
    "int": "import java.util.stream.IntStream;",
    "long": "import java.util.stream.LongStream;",
    "float": "",
    "double": "import java.util.stream.DoubleStream;",
    default: "no matching wide type"
]
