import "copyrightAndOthers.stg"

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

fileName(primitive) ::= "ImmutableObject<primitive.name>Map"

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

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

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

import org.eclipse.collections.api.block.function.primitive.<name>ToObjectFunction;
import org.eclipse.collections.api.block.predicate.primitive.Object<name>Predicate;
import org.eclipse.collections.api.block.predicate.primitive.<name>Predicate;
import org.eclipse.collections.api.block.procedure.primitive.<name>Procedure;
import org.eclipse.collections.api.collection.ImmutableCollection;
import org.eclipse.collections.api.collection.primitive.Immutable<name>Collection;

/**
 * This file was automatically generated from template file immutableObjectPrimitiveMap.stg.
 *
 * @since 3.0.
 */
public interface ImmutableObject<name>Map\<K> extends Object<name>Map\<K>
{
    @Override
    ImmutableObject<name>Map\<K> select(Object<name>Predicate\<? super K> predicate);

    @Override
    ImmutableObject<name>Map\<K> reject(Object<name>Predicate\<? super K> predicate);

    @Override
    Immutable<name>Collection select(<name>Predicate predicate);

    @Override
    Immutable<name>Collection reject(<name>Predicate predicate);

    /**
     * @since 9.0.
     */
    @Override
    default ImmutableObject<name>Map\<K> tap(<name>Procedure procedure)
    {
        this.forEach(procedure);
        return this;
    }

    @Override
    \<V> ImmutableCollection\<V> collect(<name>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}
     */
    ImmutableObject<name>Map\<K> newWithKeyValue(K key, <type> 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
     */
    ImmutableObject<name>Map\<K> newWithoutKey(K 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
     */
    ImmutableObject<name>Map\<K> newWithoutAllKeys(Iterable\<? extends K> keys);
    <if(!primitive.booleanPrimitive)><(flipUniqueValues.(name))(name)><endif>
}

>>

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

noMethods(type) ::= ""

flipUniqueValues(name) ::= <<

@Override
Immutable<name>ObjectMap\<K> flipUniqueValues();
>>
