
net.cassite.f.For Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of f Show documentation
Show all versions of f Show documentation
a library to write async vert.x code similar as using java syntax
The newest version!
package net.cassite.f;
import io.vertx.core.Future;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Arrays;
import java.util.Iterator;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
public class For {
private For() {
}
public static ForEach each(@NotNull Iterable it) {
if (it == null)
throw new NullPointerException();
return new ForEach<>(it.iterator(), true);
}
public static ForEach each(@NotNull T[] tArr) {
if (tArr == null)
throw new NullPointerException();
return new ForEach<>(Arrays.stream(tArr).iterator(), true);
}
public static ForEach each(@NotNull Iterator ite) {
if (ite == null)
throw new NullPointerException();
return new ForEach<>(ite, true);
}
static ForEach eachThrowBreak(Iterable it) {
return new ForEach<>(it.iterator(), false);
}
private interface ClearLoop {
void clear();
}
private static Future
© 2015 - 2025 Weber Informatics LLC | Privacy Policy