Package cdc.issues
Class Issue.Builder<B extends Issue.Builder<B>>
- java.lang.Object
-
- cdc.issues.Issue.Builder<B>
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringdescriptionprotected Stringdomainprotected List<Location>locationsprotected Paramsmetasprotected Stringnameprotected Paramsparamsprotected Stringprojectprotected IssueSeverityseverityprotected Stringsnapshotprotected Instanttimestamp
-
Constructor Summary
Constructors Modifier Constructor Description protectedBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BaddLocation(Location location)Adds an issue location.Issuebuild()Bdescription(String description)Sets the issue description.Bdomain(String domain)Sets the issue domain.Blocations(Location... locations)Sets the issue locations.Blocations(List<Location> locations)Sets the issue locations.Bmetas(Params metas)Sets the issue meta data.Bname(Enum<?> name)Sets the issue name and its severity if thenameimplementsIssueSeverityItemand current severity isnull.Bname(String name)Sets the issue name.Bparams(Params params)Bproject(String project)Sets the effective parameters that have been used to configure the issue detection.BruleId(RuleId ruleId)Sets the issue RuleId.protected Bself()Bseverity(IssueSeverity severity)Sets the issue severity.Bsnapshot(String snapshot)Sets the issue snapshot.Btimestamp(Instant timestamp)Sets the issue timestamp.
-
-
-
Field Detail
-
timestamp
protected Instant timestamp
-
domain
protected String domain
-
name
protected String name
-
params
protected Params params
-
project
protected String project
-
snapshot
protected String snapshot
-
severity
protected IssueSeverity severity
-
description
protected String description
-
metas
protected Params metas
-
-
Method Detail
-
self
protected B self()
-
timestamp
public B timestamp(Instant timestamp)
Sets the issue timestamp.WARNING: this should only be used to reconstruct an issue -from a file, stream, ...).
- Parameters:
timestamp- The timestamp.- Returns:
- This builder.
-
ruleId
public B ruleId(RuleId ruleId)
Sets the issue RuleId.This is equivalent to setting its domain and name.
- Parameters:
ruleId- The rule id.- Returns:
- This builder.
-
domain
public B domain(String domain)
Sets the issue domain.- Parameters:
domain- The domain.- Returns:
- This builder.
-
name
public B name(String name)
Sets the issue name.- Parameters:
name- The name.- Returns:
- This builder.
-
name
public B name(Enum<?> name)
Sets the issue name and its severity if thenameimplementsIssueSeverityItemand current severity isnull.- Parameters:
name- The name.- Returns:
- This builder.
-
project
public B project(String project)
Sets the effective parameters that have been used to configure the issue detection.- Parameters:
project- The project name.- Returns:
- This builder.
-
addLocation
public B addLocation(Location location)
Adds an issue location.- Parameters:
location- The location.- Returns:
- This builder.
-
locations
public B locations(Location... locations)
Sets the issue locations.- Parameters:
locations- The locations- Returns:
- This builder.
-
locations
public B locations(List<Location> locations)
Sets the issue locations.- Parameters:
locations- The locations- Returns:
- This builder.
-
snapshot
public B snapshot(String snapshot)
Sets the issue snapshot.- Parameters:
snapshot- The snapshot identifier.- Returns:
- This builder.
-
severity
public B severity(IssueSeverity severity)
Sets the issue severity.- Parameters:
severity- The severity.- Returns:
- This builder.
-
description
public B description(String description)
Sets the issue description.- Parameters:
description- The description.- Returns:
- This builder.
-
metas
public B metas(Params metas)
Sets the issue meta data.- Parameters:
metas- The meta data.- Returns:
- This builder.
-
build
public Issue build()
-
-