import "copyrightAndOthers.stg"

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

fileName(primitive) ::= "MutableObject<primitive.name>MapFactoryImpl"

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.MutableObject<name>MapFactory;
import org.eclipse.collections.api.map.primitive.MutableObject<name>Map;
import org.eclipse.collections.api.map.primitive.Object<name>Map;
import org.eclipse.collections.impl.factory.primitive.Object<name>Maps;
import org.eclipse.collections.impl.utility.Iterate;

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

    @Override
    public \<K> MutableObject<name>Map\<K> empty()
    {
        return new Object<name>HashMap(0);
    }

    @Override
    public \<K> MutableObject<name>Map\<K> of()
    {
        return this.empty();
    }

    @Override
    public \<K> MutableObject<name>Map\<K> with()
    {
        return this.empty();
    }

    @Override
    public \<K> MutableObject<name>Map\<K> of(K key, <type> value)
    {
        return this.with(key, value);
    }

    @Override
    public \<K> MutableObject<name>Map\<K> with(K key, <type> value)
    {
        return Object<name>HashMap.newWithKeysValues(key, value);
    }

    @Override
    public \<K> MutableObject<name>Map\<K> of(K key1, <type> value1, K key2, <type> value2)
    {
        return this.with(key1, value1, key2, value2);
    }

    @Override
    public \<K> MutableObject<name>Map\<K> with(K key1, <type> value1, K key2, <type> value2)
    {
        return Object<name>HashMap.newWithKeysValues(key1, value1, key2, value2);
    }

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

    @Override
    public \<K> MutableObject<name>Map\<K> with(K key1, <type> value1, K key2, <type> value2, K key3, <type> value3)
    {
        return Object<name>HashMap.newWithKeysValues(key1, value1, key2, value2, key3, value3);
    }

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

    @Override
    public \<K> MutableObject<name>Map\<K> with(K key1, <type> value1, K key2, <type> value2, K key3, <type> value3, K key4, <type> value4)
    {
        return Object<name>HashMap.newWithKeysValues(key1, value1, key2, value2, key3, value3, key4, value4);
    }

    @Override
    public \<K> MutableObject<name>Map\<K> ofInitialCapacity(int capacity)
    {
        return this.withInitialCapacity(capacity);
    }

    @Override
    public \<K> MutableObject<name>Map\<K> withInitialCapacity(int capacity)
    {
        return new Object<name>HashMap\<>(capacity);
    }

    @Override
    public \<K> MutableObject<name>Map\<K> ofAll(Object<name>Map\<? extends K> map)
    {
        return this.withAll(map);
    }

    @Override
    public \<K> MutableObject<name>Map\<K> withAll(Object<name>Map\<? extends K> map)
    {
        if (map.isEmpty())
        {
            return this.empty();
        }
        return new Object<name>HashMap\<>(map);
    }

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

>>
