/** * Returns a builder based on the given status. * * @param success true if successful, false otherwise. */ public static <T> RpcResultBuilder<T> status(final boolean success) { return new RpcResultBuilder<>(success, null); }
/** * Returns a builder for a successful result. */ public static <T> RpcResultBuilder<T> success() { return new RpcResultBuilder<>(true, null); }
/** * Returns a builder for a successful result. * * @param result the result value */ public static <T> RpcResultBuilder<T> success(final T result) { return new RpcResultBuilder<>(true, result); }
/** * Returns a builder for a successful result. * * @param result the result value */ public static <T> RpcResultBuilder<T> success(final T result) { return new RpcResultBuilder<>(true, result); }
/** * Returns a builder for a failed result. */ public static <T> RpcResultBuilder<T> failed() { return new RpcResultBuilder<>(false, null); }
/** * Returns a builder for a successful result. */ public static <T> RpcResultBuilder<T> success() { return new RpcResultBuilder<>(true, null); }
/** * Returns a builder for a failed result. */ public static <T> RpcResultBuilder<T> failed() { return new RpcResultBuilder<>(false, null); }
/** * Returns a builder based on the given status. * * @param success true if successful, false otherwise. */ public static <T> RpcResultBuilder<T> status(final boolean success) { return new RpcResultBuilder<>(success, null); }
/** * Returns a builder from another RpcResult. * * @param other the other RpcResult. */ public static <T> RpcResultBuilder<T> from(final RpcResult<T> other) { return new RpcResultBuilder<>(other.isSuccessful(), other.getResult()) .withRpcErrors(other.getErrors()); }
/** * Returns a builder from another RpcResult. * * @param other the other RpcResult. */ public static <T> RpcResultBuilder<T> from(final RpcResult<T> other) { return new RpcResultBuilder<>(other.isSuccessful(), other.getResult()) .withRpcErrors(other.getErrors()); }