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

org.kiwiproject.test.util.IntStreams Maven / Gradle / Ivy

There is a newer version: 3.7.0
Show newest version
package org.kiwiproject.test.util;

import lombok.experimental.UtilityClass;

import java.util.List;
import java.util.stream.IntStream;

// TODO: We've only used this in test code. Is it worth moving to kiwi? i.e. is there any non-testing
//  situation this might be useful?

/**
 * Static utilities related to {@link IntStream}.
 */
@UtilityClass
public class IntStreams {

    /**
     * Return an {@link IntStream} whose values are the indices ranging from {@code 0} to {@code values.size() - 1}.
     *
     * @param values the list
     * @param     the list element type
     * @return IntStream of the list indices
     */
    public static  IntStream indicesOf(List values) {
        return IntStream.range(0, values.size());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy