*/
package org.sonar.scanner.scan.branch;
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
import javax.annotation.concurrent.Immutable;
/**
private final String name;
private final BranchType type;
private final boolean isMain;
+ @Nullable
+ private final String branchTargetName;
- public BranchInfo(String name, BranchType type, boolean isMain) {
+ public BranchInfo(String name, BranchType type, boolean isMain, @Nullable String branchTargetName) {
this.name = name;
this.type = type;
this.isMain = isMain;
+ this.branchTargetName = branchTargetName;
+ }
+
+ @CheckForNull
+ public String branchTargetName() {
+ return branchTargetName;
}
public String name() {
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
+import javax.annotation.CheckForNull;
import javax.annotation.concurrent.Immutable;
/**
branches = branchInfos.stream().collect(Collectors.toMap(BranchInfo::name, Function.identity()));
}
+ @CheckForNull
public BranchInfo get(String name) {
return branches.get(name);
}