public static final class TestError.Builder extends java.lang.Object
TestError
.Modifier and Type | Field and Description |
---|---|
private int |
code |
private java.lang.String |
description |
private java.lang.String |
descriptionEn |
private java.util.function.Supplier<Command> |
fixingCommand |
private java.util.Collection<?> |
highlighted |
private java.lang.String |
message |
private java.util.Collection<? extends OsmPrimitive> |
primitives |
private Severity |
severity |
private Test |
tester |
Constructor and Description |
---|
Builder(Test tester,
Severity severity,
int code) |
Modifier and Type | Method and Description |
---|---|
TestError |
build()
Returns a new test error with the specified values
|
TestError.Builder |
fix(java.util.function.Supplier<Command> fixingCommand)
Sets a supplier to obtain a command to fix the error.
|
TestError.Builder |
highlight(java.util.Collection<? extends OsmPrimitive> highlighted)
Sets the primitives to highlight when selecting this error.
|
TestError.Builder |
highlight(OsmPrimitive... highlighted)
Sets the primitives to highlight when selecting this error.
|
TestError.Builder |
highlightNodePairs(java.util.Collection<java.util.List<Node>> highlighted)
Sets the node pairs to highlight when selecting this error.
|
TestError.Builder |
highlightWaySegments(java.util.Collection<WaySegment> highlighted)
Sets the way segments to highlight when selecting this error.
|
TestError.Builder |
message(java.lang.String message)
Sets the error message.
|
TestError.Builder |
message(java.lang.String message,
java.lang.String marktrDescription,
java.lang.Object... args)
Sets the error message.
|
TestError.Builder |
messageWithManuallyTranslatedDescription(java.lang.String message,
java.lang.String description,
java.lang.String descriptionEn)
Sets the error message.
|
TestError.Builder |
primitives(java.util.Collection<? extends OsmPrimitive> primitives)
Sets the primitives affected by this error.
|
TestError.Builder |
primitives(OsmPrimitive... primitives)
Sets the primitives affected by this error.
|
private final int code
private java.lang.String message
private java.lang.String description
private java.lang.String descriptionEn
private java.util.Collection<? extends OsmPrimitive> primitives
private java.util.Collection<?> highlighted
private java.util.function.Supplier<Command> fixingCommand
public TestError.Builder message(java.lang.String message)
message
- The error messagethis
public TestError.Builder messageWithManuallyTranslatedDescription(java.lang.String message, java.lang.String description, java.lang.String descriptionEn)
message
- The the message of this error groupdescription
- The translated description of this errordescriptionEn
- The English description (for ignoring errors)this
public TestError.Builder message(java.lang.String message, java.lang.String marktrDescription, java.lang.Object... args)
message
- The the message of this error groupmarktrDescription
- The prepared for i18n description of this errorargs
- The description arguments to be applied in I18n.tr(String, Object...)
this
public TestError.Builder primitives(OsmPrimitive... primitives)
primitives
- the primitives affected by this errorthis
public TestError.Builder primitives(java.util.Collection<? extends OsmPrimitive> primitives)
primitives
- the primitives affected by this errorthis
public TestError.Builder highlight(OsmPrimitive... highlighted)
highlighted
- the primitives to highlightthis
ValidatorVisitor.visit(OsmPrimitive)
public TestError.Builder highlight(java.util.Collection<? extends OsmPrimitive> highlighted)
highlighted
- the primitives to highlightthis
ValidatorVisitor.visit(OsmPrimitive)
public TestError.Builder highlightWaySegments(java.util.Collection<WaySegment> highlighted)
highlighted
- the way segments to highlightthis
ValidatorVisitor.visit(WaySegment)
public TestError.Builder highlightNodePairs(java.util.Collection<java.util.List<Node>> highlighted)
highlighted
- the node pairs to highlightthis
ValidatorVisitor.visit(List)
public TestError.Builder fix(java.util.function.Supplier<Command> fixingCommand)
fixingCommand
- the fix supplier. Can be nullthis
public TestError build()
java.lang.IllegalArgumentException
- when message
or primitives
is null/empty.