import "copyrightAndOthers.stg"

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

fileName(primitive) ::= "Immutable<primitive.name>ListFactory"

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

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

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

import org.eclipse.collections.api.<name>Iterable;
import org.eclipse.collections.api.list.primitive.Immutable<name>List;
<(wideStreamImport.(type))>

/**
 * A factory which creates instances of type {@link Immutable<name>List}.
 * This file was automatically generated from template file immutablePrimitiveListFactory.stg.
 *
 * @since 3.2.
 */
public interface Immutable<name>ListFactory
{
    /**
     * @since 6.0
     */
    Immutable<name>List empty();

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

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

    /**
     * Same as {@link #with(<type>)}.
     */
    Immutable<name>List of(<type> one);

    Immutable<name>List with(<type> one);

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

    Immutable<name>List with(<type>... items);

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

    Immutable<name>List withAll(<name>Iterable items);

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

    Immutable<name>List 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
 */
Immutable<name>List ofAll(<(wideStream.(type))> items);

/**
 * @since 9.0
 */
Immutable<name>List 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"
]
