Package org.apache.maven.model.building
Class Result<T>
- java.lang.Object
-
- org.apache.maven.model.building.Result<T>
-
- Type Parameters:
T
-
public class Result<T> extends Object
There are various forms of results that are represented by this class:- success - in which case only the model field is set
- success with warnings - model field + non-error model problems
- error - no model, but diagnostics
- error - (partial) model and diagnostics
- Author:
- bbusjaeger
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> Result<T>
addProblem(Result<T> result, ModelProblem problem)
New result consisting of given result and new problem.static <T> Result<T>
addProblems(Result<T> result, Iterable<? extends ModelProblem> problems)
New result that includes the givenstatic <T> Result<T>
addProblems(Result<T> result, Result<?>... results)
static <T> Result<T>
error(Iterable<? extends ModelProblem> problems)
Error with problems describing the causestatic <T> Result<T>
error(Result<?> result)
static <T> Result<T>
error(Result<?>... results)
static <T> Result<T>
error(T model)
static <T> Result<T>
error(T model, Iterable<? extends ModelProblem> problems)
Error with partial result and problems describing the causeT
get()
Iterable<? extends ModelProblem>
getProblems()
boolean
hasErrors()
static <T> Result<T>
newResult(T model, Iterable<? extends ModelProblem> problems)
New result - determine whether error or success by checking problems for errorsstatic <T> Result<Iterable<T>>
newResultSet(Iterable<? extends Result<? extends T>> results)
Turns the given results into a single result by combining problems and models into single collection.static <T> Result<T>
success(T model)
Success without warningsstatic <T> Result<T>
success(T model, Iterable<? extends ModelProblem> problems)
Success with warningsstatic <T> Result<T>
success(T model, Result<?>... results)
Success with warnings
-
-
-
Method Detail
-
success
public static <T> Result<T> success(T model)
Success without warnings- Parameters:
model
-
-
success
public static <T> Result<T> success(T model, Iterable<? extends ModelProblem> problems)
Success with warnings- Parameters:
model
-problems
-
-
success
public static <T> Result<T> success(T model, Result<?>... results)
Success with warnings- Parameters:
model
-results
-
-
error
public static <T> Result<T> error(Iterable<? extends ModelProblem> problems)
Error with problems describing the cause- Parameters:
problems
-
-
error
public static <T> Result<T> error(T model)
-
error
public static <T> Result<T> error(T model, Iterable<? extends ModelProblem> problems)
Error with partial result and problems describing the cause- Parameters:
model
-problems
-
-
newResult
public static <T> Result<T> newResult(T model, Iterable<? extends ModelProblem> problems)
New result - determine whether error or success by checking problems for errors- Parameters:
model
-problems
-
-
addProblem
public static <T> Result<T> addProblem(Result<T> result, ModelProblem problem)
New result consisting of given result and new problem. Convenience for newResult(result.get(), concat(result.getProblems(),problems)).- Parameters:
result
-problem
-
-
addProblems
public static <T> Result<T> addProblems(Result<T> result, Iterable<? extends ModelProblem> problems)
New result that includes the given- Parameters:
result
-problems
-
-
newResultSet
public static <T> Result<Iterable<T>> newResultSet(Iterable<? extends Result<? extends T>> results)
Turns the given results into a single result by combining problems and models into single collection.- Parameters:
results
-
-
getProblems
public Iterable<? extends ModelProblem> getProblems()
-
get
public T get()
-
hasErrors
public boolean hasErrors()
-
-