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

io.github.icodegarden.nutrient.lang.result.Results Maven / Gradle / Ivy

There is a newer version: 3.0.2
Show newest version
package io.github.icodegarden.nutrient.lang.result;

import java.util.function.Function;

import io.github.icodegarden.nutrient.lang.annotation.Nullable;

/**
 * 
 * @author Fangfang.Xu
 *
 */
@SuppressWarnings({ "rawtypes" })
public abstract class Results implements Function {

	public static Result of(boolean success) {
		return new Result(success);
	}

	public static  Result1 of(boolean success, @Nullable T1 t1) {
		return new Result1<>(success, t1);
	}

	public static  Result2 of(boolean success, @Nullable T1 t1, @Nullable T2 t2) {
		return new Result2<>(success, t1, t2);
	}

	public static  Result3 of(boolean success, @Nullable T1 t1, @Nullable T2 t2,
			@Nullable T3 t3) {
		return new Result3<>(success, t1, t2, t3);
	}

	public static  Result4 of(boolean success, @Nullable T1 t1, @Nullable T2 t2,
			@Nullable T3 t3, @Nullable T4 t4) {
		return new Result4<>(success, t1, t2, t3, t4);
	}

	Results() {
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy