import "copyright.stg"

skipBooleanKeys() ::= "true"

hasTwoPrimitives() ::= "true"

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

fileName(primitive1, primitive2, sameTwoPrimitives) ::= "Immutable<primitive1.name><primitive2.name>Map"

class(primitive1, primitive2, sameTwoPrimitives) ::= <<
<body(primitive1.type, primitive2.type, primitive1.name, primitive2.name)>
>>

body(type1, type2, name1, name2) ::= <<
<copyright()>

package org.eclipse.collections.api.map.primitive;

import org.eclipse.collections.api.<name1>Iterable;
import org.eclipse.collections.api.bag.ImmutableBag;
import org.eclipse.collections.api.bag.primitive.Immutable<name2>Bag;
import org.eclipse.collections.api.block.function.primitive.<name2>ToObjectFunction;
import org.eclipse.collections.api.block.predicate.primitive.<name2>Predicate;
import org.eclipse.collections.api.block.predicate.primitive.<name1><name2>Predicate;

/**
 * This file was automatically generated from template file immutablePrimitivePrimitiveMap.stg.
 *
 * @since 3.0.
 */
public interface Immutable<name1><name2>Map extends <name1><name2>Map
{
    @Override
    Immutable<name1><name2>Map select(<name1><name2>Predicate predicate);

    @Override
    Immutable<name1><name2>Map reject(<name1><name2>Predicate predicate);

    @Override
    Immutable<name2>Bag select(<name2>Predicate predicate);

    @Override
    Immutable<name2>Bag reject(<name2>Predicate predicate);

    @Override
    \<V> ImmutableBag\<V> collect(<name2>ToObjectFunction\<? extends V> function);

    /**
     * Copy this map, associate the value with the key (replacing the value if one
     * already exists for {@code key}), and return the copy as new immutable map.
     * A copy is always made even if {@code key} is already associated with {@code value}.
     * @param key the key to add
     * @param value the value to associate with the key in the copy
     * @return an immutable copy of this map with {@code value} associated with {@code key}
     */
    Immutable<name1><name2>Map newWithKeyValue(<type1> key, <type2> value);

    /**
     * Copy this map, remove any associated value with the key (if one exists), and
     * return the copy as a new immutable map.
     * @param key the key to remove
     * @return an immutable copy of this map with {@code key} removed
     */
    Immutable<name1><name2>Map newWithoutKey(<type1> key);

    /**
     * Copy this map, remove any associated values with the specified keys (if any exist),
     * and return the copy as a new immutable map.
     * @param keys the keys to remove
     * @return an immutable copy of this map with all keys in {@code keys} removed
     */
    Immutable<name1><name2>Map newWithoutAllKeys(<name1>Iterable keys);
    <if(!primitive2.booleanPrimitive)><(flipUniqueValues.(name2))(name1, name2)><endif>
}

>>

flipUniqueValues ::= [
    "Byte": "flipUniqueValues",
    "Short": "flipUniqueValues",
    "Char": "flipUniqueValues",
    "Int": "flipUniqueValues",
    "Long": "flipUniqueValues",
    "Float": "flipUniqueValues",
    "Double": "flipUniqueValues",
    "Boolean": "noMethods"
    ]

noMethods(name1, name2) ::= ""

flipUniqueValues(name1, name2) ::= <<

@Override
Immutable<name2><name1>Map flipUniqueValues();
>>
