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

org.openlca.ipc.handlers.Effect Maven / Gradle / Ivy

There is a newer version: 2.2.1
Show newest version
package org.openlca.ipc.handlers;

import org.openlca.ipc.RpcResponse;

/**
 * An effect encodes the result of some internal IPC call. On success, it will
 * contain a value and an RPC error when the call failed.
 */
record Effect(T value, RpcResponse error) {

	static  Effect ok(T value) {
		return new Effect<>(value, null);
	}

	static  Effect error(RpcResponse err) {
		return new Effect<>(null, err);
	}

	boolean isError() {
		return error != null;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy