All Downloads are FREE. Search and download functionalities are using the official Maven repository.

solid.converters.ToSolidMap Maven / Gradle / Ivy

package solid.converters;

import java.util.Map;

import solid.collections.SolidMap;
import solid.functions.SolidFunc1;

public class ToSolidMap implements SolidFunc1>, SolidMap> {

    private static final ToSolidMap TO_SOLID_MAP = new ToSolidMap<>();

    /**
     * Returns a method that can be used with {@link solid.stream.Stream#collect(SolidFunc1)}
     * to convert a stream of {@link Map.Entry} into a {@link SolidMap}.
     *
     * @param  a type of {@link SolidMap} keys.
     * @param  a type of {@link SolidMap} values.
     * @return a method that converts an iterable into a {@link SolidMap}.
     */
    public static  SolidFunc1>, SolidMap> toSolidMap() {
        //noinspection unchecked
        return TO_SOLID_MAP;
    }

    @Override
    public SolidMap call(Iterable> value) {
        return new SolidMap<>(value);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy