import "copyrightAndOthers.stg"

skipBoolean() ::= "true"

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

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

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

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

package org.eclipse.collections.impl.map.mutable.primitive;

import org.eclipse.collections.api.block.function.Function;
import org.eclipse.collections.api.block.function.primitive.<name>Function;
import org.eclipse.collections.api.factory.map.primitive.Mutable<name>ObjectMapFactory;
import org.eclipse.collections.api.map.primitive.Mutable<name>ObjectMap;
import org.eclipse.collections.api.map.primitive.<name>ObjectMap;
import org.eclipse.collections.impl.factory.primitive.<name>ObjectMaps;
import org.eclipse.collections.impl.utility.Iterate;

/**
 * Mutable<name>ObjectMapFactoryImpl is a factory implementation which creates instances of type {@link Mutable<name>ObjectMap}.
 * This file was automatically generated from template file mutablePrimitiveObjectMapFactoryImpl.stg.
 *
 * @since 6.0.
 */
public class Mutable<name>ObjectMapFactoryImpl implements Mutable<name>ObjectMapFactory
{
    public static final Mutable<name>ObjectMapFactory INSTANCE = new Mutable<name>ObjectMapFactoryImpl();

    @Override
    public \<V> Mutable<name>ObjectMap\<V> empty()
    {
        return new <name>ObjectHashMap(0);
    }

    @Override
    public \<V> Mutable<name>ObjectMap\<V> of()
    {
        return this.empty();
    }

    @Override
    public \<V> Mutable<name>ObjectMap\<V> with()
    {
        return this.empty();
    }

    @Override
    public \<V> Mutable<name>ObjectMap\<V> of(<type> key, V value)
    {
        return this.with(key, value);
    }

    @Override
    public \<V> Mutable<name>ObjectMap\<V> with(<type> key, V value)
    {
        return <name>ObjectHashMap.newWithKeysValues(key, value);
    }

    @Override
    public \<V> Mutable<name>ObjectMap\<V> of(<type> key1, V value1, <type> key2, V value2)
    {
        return this.with(key1, value1, key2, value2);
    }

    @Override
    public \<V> Mutable<name>ObjectMap\<V> with(<type> key1, V value1, <type> key2, V value2)
    {
        return <name>ObjectHashMap.newWithKeysValues(key1, value1, key2, value2);
    }

    @Override
    public \<V> Mutable<name>ObjectMap\<V> of(<type> key1, V value1, <type> key2, V value2, <type> key3, V value3)
    {
        return this.with(key1, value1, key2, value2, key3, value3);
    }

    @Override
    public \<V> Mutable<name>ObjectMap\<V> with(<type> key1, V value1, <type> key2, V value2, <type> key3, V value3)
    {
        return <name>ObjectHashMap.newWithKeysValues(key1, value1, key2, value2, key3, value3);
    }

    @Override
    public \<V> Mutable<name>ObjectMap\<V> of(<type> key1, V value1, <type> key2, V value2, <type> key3, V value3, <type> key4, V value4)
    {
        return this.with(key1, value1, key2, value2, key3, value3, key4, value4);
    }

    @Override
    public \<V> Mutable<name>ObjectMap\<V> with(<type> key1, V value1, <type> key2, V value2, <type> key3, V value3, <type> key4, V value4)
    {
        return <name>ObjectHashMap.newWithKeysValues(key1, value1, key2, value2, key3, value3, key4, value4);
    }

    @Override
    public \<V> Mutable<name>ObjectMap\<V> ofInitialCapacity(int capacity)
    {
        return this.withInitialCapacity(capacity);
    }

    @Override
    public \<V> Mutable<name>ObjectMap\<V> withInitialCapacity(int capacity)
    {
        return new <name>ObjectHashMap\<>(capacity);
    }

    @Override
    public \<V> Mutable<name>ObjectMap\<V> ofAll(<name>ObjectMap\<? extends V> map)
    {
        return this.withAll(map);
    }

    @Override
    public \<V> Mutable<name>ObjectMap\<V> withAll(<name>ObjectMap\<? extends V> map)
    {
        if (map.isEmpty())
        {
            return this.empty();
        }
        return new <name>ObjectHashMap\<>(map);
    }

    @Override
    public \<T, V> Mutable<name>ObjectMap\<V> from(Iterable\<T> iterable, <name>Function\<? super T> keyFunction, Function\<? super T, ? extends V> valueFunction)
    {
        Mutable<name>ObjectMap\<V> map = <name>ObjectMaps.mutable.empty();
        Iterate.forEach(iterable, each -> map.put(keyFunction.<type>ValueOf(each), valueFunction.valueOf(each)));
        return map;
    }
}

>>
