diff --git a/pom.xml b/pom.xml index 1fce790..0c7e239 100644 --- a/pom.xml +++ b/pom.xml @@ -109,6 +109,29 @@ + + com.google.protobuf + protobuf-java + 3.21.6 + + + + net.jpountz.lz4 + lz4 + 1.3.0 + + + + com.google.guava + guava + 20.0 + + + + + org.projectlombok + lombok + diff --git a/src/main/java/net/educoder/ecsonar/controller/QualityInspectController.java b/src/main/java/net/educoder/ecsonar/controller/QualityInspectController.java index 6213e13..751fb36 100644 --- a/src/main/java/net/educoder/ecsonar/controller/QualityInspectController.java +++ b/src/main/java/net/educoder/ecsonar/controller/QualityInspectController.java @@ -6,14 +6,17 @@ import net.educoder.ecsonar.model.RollPage; import net.educoder.ecsonar.model.api.QualityInspect; import net.educoder.ecsonar.model.api.QualityInspectIsCompleted; import net.educoder.ecsonar.model.api.QualityInspectResultData; -import net.educoder.ecsonar.model.vo.QualityInspectUserDataVO; -import net.educoder.ecsonar.model.vo.QualityInspectVO; +import net.educoder.ecsonar.model.dto.AnalyseDetailDTO; +import net.educoder.ecsonar.model.dto.AnalyseDetailListDTO; +import net.educoder.ecsonar.model.dto.CodeDetailDTO; +import net.educoder.ecsonar.model.vo.*; import net.educoder.ecsonar.services.QualityInspectService; import net.educoder.ecsonar.utils.ResponseResult; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.*; +import javax.validation.Valid; import java.util.List; /** @@ -31,18 +34,19 @@ public class QualityInspectController { /** * 质量检测 - * @param language 语言 + * + * @param language 语言 * @param homeworkId 实训作业id - * @param userDatas 用户数据 + * @param userDatas 用户数据 * @return */ @RequestMapping(value = "qualityInspect", method = RequestMethod.POST) @ResponseBody public ResponseResult qualityInspect(@RequestParam String language, @RequestParam String homeworkId, - @RequestParam String userDatas){ + @RequestParam String userDatas) { - List userDataVOList = JSONArray.parseArray(userDatas,QualityInspectUserDataVO.class); + List userDataVOList = JSONArray.parseArray(userDatas, QualityInspectUserDataVO.class); QualityInspectVO qualityInspectVO = new QualityInspectVO(language, homeworkId, userDataVOList); if (!Constant.language.contains(qualityInspectVO.getLanguage())) { @@ -55,12 +59,13 @@ public class QualityInspectController { /** * 质量检测任务是否完成 + * * @param taskId * @return */ @RequestMapping(value = "qualityInspectIsCompleted", method = RequestMethod.GET) @ResponseBody - public ResponseResult qualityInspectIsCompleted(@RequestParam String taskId){ + public ResponseResult qualityInspectIsCompleted(@RequestParam String taskId) { QualityInspectIsCompleted result = qualityInspectService.qualityInspectIsCompleted(taskId); return ResponseResult.success(result); } @@ -68,6 +73,7 @@ public class QualityInspectController { /** * 质量检测结果查询 + * * @param taskId * @return */ @@ -76,19 +82,71 @@ public class QualityInspectController { public ResponseResult> qualityInspectResultQuery( @RequestParam(defaultValue = "50") Integer pageSize, @RequestParam(defaultValue = "1") Integer pageNum, - @RequestParam String taskId){ + @RequestParam String taskId) { if (pageNum <= 1) { pageNum = 1; } QualityInspectIsCompleted isCompleted = qualityInspectService.qualityInspectIsCompleted(taskId); - if(isCompleted.getCompleted() != 1){ + if (isCompleted.getCompleted() != 1) { return ResponseResult.error("质量检测正在处理中"); } - RollPage result = qualityInspectService.qualityInspectResultQuery(pageNum, pageSize,taskId); + RollPage result = qualityInspectService.qualityInspectResultQuery(pageNum, pageSize, taskId); return ResponseResult.success(result); } + + /** + * 分析详情 + * + * @return + */ + @GetMapping("/analyseDetail") + @ResponseBody + public ResponseResult analyseDetail(@Valid AnalyseDetailVO analyseDetailVO) { + AnalyseDetailDTO analyseDetailDTO = qualityInspectService.getAnalyseDetail(analyseDetailVO); + return ResponseResult.success(analyseDetailDTO); + } + + /** + * 分析详情列表 + * + * @return + */ + @GetMapping("/analyseDetailList") + @ResponseBody + public ResponseResult analyseDetailList(@Valid AnalyseDetailListVO analyseDetailListVO) { + RollPage rollPage = qualityInspectService.getAnalyseDetailList(analyseDetailListVO); + return ResponseResult.success(rollPage); + } + + + /** + * 问题分析 + * + * @return + */ + @GetMapping("/problemAnalysis") + @ResponseBody + public ResponseResult problemAnalysis(@RequestParam Integer ruleId) { + String description = qualityInspectService.getProblemAnalysis(ruleId); + return ResponseResult.success(description); + } + + + /** + * 代码详情 + * + * @return + */ + @GetMapping("/codeDetail") + @ResponseBody + public ResponseResult codeDetail(@Valid CodeDetailVO codeDetailVO) { + CodeDetailDTO codeDetail = qualityInspectService.getCodeDetail(codeDetailVO); + return ResponseResult.success(codeDetail); + } + + } diff --git a/src/main/java/net/educoder/ecsonar/dao/FileSourceDao.java b/src/main/java/net/educoder/ecsonar/dao/FileSourceDao.java new file mode 100644 index 0000000..8ff9bea --- /dev/null +++ b/src/main/java/net/educoder/ecsonar/dao/FileSourceDao.java @@ -0,0 +1,19 @@ +package net.educoder.ecsonar.dao; + +import net.educoder.ecsonar.model.FileSource; +import org.apache.ibatis.annotations.Param; + +/** + * @Author: youys + * @Date: 2022/12/20 + * @Description: + */ +public interface FileSourceDao { + + /** + * 根据file_uuid查询源文件 + * @param fileUuid + * @return + */ + FileSource findFileSourceFileUuid(@Param("fileUuid") String fileUuid); +} diff --git a/src/main/java/net/educoder/ecsonar/dao/IssuesDao.java b/src/main/java/net/educoder/ecsonar/dao/IssuesDao.java new file mode 100644 index 0000000..a3d24c0 --- /dev/null +++ b/src/main/java/net/educoder/ecsonar/dao/IssuesDao.java @@ -0,0 +1,44 @@ +package net.educoder.ecsonar.dao; + +import net.educoder.ecsonar.model.Issues; +import net.educoder.ecsonar.model.dto.DegreeDTO; + +import java.util.List; + +/** + * @Author: youys + * @Date: 2022/12/20 + * @Description: + */ +public interface IssuesDao { + + + /** + * 查询issue总记录数 + * @param projectUuid + * @param issueType + * @param severity + * @return + */ + Integer getPageIssuesCount(String projectUuid,Integer issueType, String severity); + + /** + * 分页查询issue列表 + * @param projectUuid + * @param issueType + * @param severity + * @param start + * @param pageSize + * @return + */ + List getPageIssues(String projectUuid,Integer issueType, String severity, Integer start, Integer pageSize); + + + /** + * 查询不同程度的漏洞、缺陷、代码规范数量 + * @param projectUuid + * @param issueType + * @return + */ + DegreeDTO queryDegree(String projectUuid, Integer issueType); +} diff --git a/src/main/java/net/educoder/ecsonar/dao/ProjectDao.java b/src/main/java/net/educoder/ecsonar/dao/ProjectDao.java index 9cf13ec..ccb1482 100644 --- a/src/main/java/net/educoder/ecsonar/dao/ProjectDao.java +++ b/src/main/java/net/educoder/ecsonar/dao/ProjectDao.java @@ -3,6 +3,7 @@ package net.educoder.ecsonar.dao; import net.educoder.ecsonar.model.IssuesMetrics; import net.educoder.ecsonar.model.Metrics; import net.educoder.ecsonar.model.Project; +import net.educoder.ecsonar.model.Rule; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; @@ -58,4 +59,11 @@ public interface ProjectDao { "(select count(1) from issues where project_uuid=#{projectUuid} and issue_type=3) vulnerability," + "(select value from project_measures pm where component_uuid=#{projectUuid} and metric_id=3) codeLines") IssuesMetrics selectIssuesMetrics(String projectUuid); + + /** + * 查询rule + * @param id + * @return + */ + Rule findRuleById(@Param("id") Integer id); } diff --git a/src/main/java/net/educoder/ecsonar/enums/AnalyseTypeEnum.java b/src/main/java/net/educoder/ecsonar/enums/AnalyseTypeEnum.java new file mode 100644 index 0000000..54c7af4 --- /dev/null +++ b/src/main/java/net/educoder/ecsonar/enums/AnalyseTypeEnum.java @@ -0,0 +1,36 @@ +package net.educoder.ecsonar.enums; + + +/** + * @Author: youys + * @Date: 2022/12/20 + * @Description: 分析类型 + */ +public enum AnalyseTypeEnum { + + CodeSmell(1), + BUG(2), + Vulnerability(3); + + private Integer type; + + + AnalyseTypeEnum(Integer type) { + this.type = type; + } + + + public Integer getType() { + return type; + } + + public static AnalyseTypeEnum getAnalyseTypeEnum(Integer type) { + for (AnalyseTypeEnum analyseType : values()) { + if (analyseType.type.equals(type)) { + return analyseType; + } + } + throw new RuntimeException("Not Found AnalyseTypeEnum by type=" + type); + } + +} diff --git a/src/main/java/net/educoder/ecsonar/enums/DegreeEnum.java b/src/main/java/net/educoder/ecsonar/enums/DegreeEnum.java new file mode 100644 index 0000000..a72b3c1 --- /dev/null +++ b/src/main/java/net/educoder/ecsonar/enums/DegreeEnum.java @@ -0,0 +1,59 @@ +package net.educoder.ecsonar.enums; + +/** + * @Author: youys + * @Date: 2022/12/20 + * @Description: 严重程度 + */ +public enum DegreeEnum { + + All(0, "ALL", "全部"), + Blocker(1, "BLOCKER", "阻断"), + Critical(2, "CRITICAL", "严重"), + Major(3, "MAJOR", "主要"), + Minor(4, "MINOR", "次要"), + Info(5, "INFO", "提示"); + + + /** + * 传值类型 + */ + private Integer type; + /** + * 对应数据库类型 + */ + private String value; + /** + * 描述 + */ + private String desc; + + DegreeEnum(Integer type, String value, String desc) { + this.type = type; + this.value = value; + this.desc = desc; + } + + + public static DegreeEnum getDegreeEnum(Integer type) { + for (DegreeEnum de : values()) { + if (de.type.equals(type)) { + return de; + } + } + throw new RuntimeException("Not Found DegreeEnum by type=" + type); + } + + + public Integer getType() { + return type; + } + + public String getValue() { + return value; + } + + public String getDesc() { + return desc; + } +} diff --git a/src/main/java/net/educoder/ecsonar/model/FileSource.java b/src/main/java/net/educoder/ecsonar/model/FileSource.java new file mode 100644 index 0000000..5ec9645 --- /dev/null +++ b/src/main/java/net/educoder/ecsonar/model/FileSource.java @@ -0,0 +1,62 @@ +package net.educoder.ecsonar.model; + +import com.google.protobuf.CodedInputStream; +import com.google.protobuf.InvalidProtocolBufferException; +import lombok.Data; +import net.educoder.ecsonar.protobuf.DbFileSources; +import net.jpountz.lz4.LZ4BlockInputStream; + +import java.io.ByteArrayInputStream; +import java.io.IOException; + +import static java.lang.String.format; + +/** + * @Author: youys + * @Date: 2022/9/27 + * @Description: + */ +@Data +public class FileSource { + + private static final String SIZE_LIMIT_EXCEEDED_EXCEPTION_MESSAGE = "Protocol message was too large. May be malicious. " + + "Use CodedInputStream.setSizeLimit() to increase the size limit."; + + private Long id; + private String projectUuid; + private String fileUuid; + private String lineHashes; + + private String srcHash; + private byte[] binaryData = new byte[0]; + private String dataHash; + + public DbFileSources.Data decodeSourceData(byte[] binaryData) { + try { + return decodeRegularSourceData(binaryData); + } catch (IOException e) { + throw new IllegalStateException( + format("Fail to decompress and deserialize source data [id=%s,fileUuid=%s,projectUuid=%s]", id, fileUuid, projectUuid), + e); + } + } + + private static DbFileSources.Data decodeRegularSourceData(byte[] binaryData) throws IOException { + try (LZ4BlockInputStream lz4Input = new LZ4BlockInputStream(new ByteArrayInputStream(binaryData))) { + return DbFileSources.Data.parseFrom(lz4Input); + } catch (InvalidProtocolBufferException e) { + if (SIZE_LIMIT_EXCEEDED_EXCEPTION_MESSAGE.equals(e.getMessage())) { + return decodeHugeSourceData(binaryData); + } + throw e; + } + } + + private static DbFileSources.Data decodeHugeSourceData(byte[] binaryData) throws IOException { + try (LZ4BlockInputStream lz4Input = new LZ4BlockInputStream(new ByteArrayInputStream(binaryData))) { + CodedInputStream input = CodedInputStream.newInstance(lz4Input); + input.setSizeLimit(Integer.MAX_VALUE); + return DbFileSources.Data.parseFrom(input); + } + } +} diff --git a/src/main/java/net/educoder/ecsonar/model/Issues.java b/src/main/java/net/educoder/ecsonar/model/Issues.java new file mode 100644 index 0000000..cab2c5c --- /dev/null +++ b/src/main/java/net/educoder/ecsonar/model/Issues.java @@ -0,0 +1,144 @@ +package net.educoder.ecsonar.model; + + +/** + * @Author: youys + * @Date: 2022/9/19 + * @Description: + */ +public class Issues { + + private Long id; + private String kee; + private Integer ruleId; + private String severity; + private String message; + private String status; + private String projectUuid; + private Integer issueType; + private byte[] locations = new byte[0]; + + /** + * bug名称 + */ + private String name; + /** + * bug描述 + */ + private String description; + /** + * 文件路径 + */ + private String path; + + /** + * 对应file_sources表的file_uuid + * 对应issue表的component_uuid + */ + private String uuid; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getKee() { + return kee; + } + + public void setKee(String kee) { + this.kee = kee; + } + + public Integer getRuleId() { + return ruleId; + } + + public void setRuleId(Integer ruleId) { + this.ruleId = ruleId; + } + + public String getSeverity() { + return severity; + } + + public void setSeverity(String severity) { + this.severity = severity; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getProjectUuid() { + return projectUuid; + } + + public void setProjectUuid(String projectUuid) { + this.projectUuid = projectUuid; + } + + public Integer getIssueType() { + return issueType; + } + + public void setIssueType(Integer issueType) { + this.issueType = issueType; + } + + public byte[] getLocations() { + return locations; + } + + public void setLocations(byte[] locations) { + this.locations = locations; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } +} diff --git a/src/main/java/net/educoder/ecsonar/model/Rule.java b/src/main/java/net/educoder/ecsonar/model/Rule.java new file mode 100644 index 0000000..44e598b --- /dev/null +++ b/src/main/java/net/educoder/ecsonar/model/Rule.java @@ -0,0 +1,16 @@ +package net.educoder.ecsonar.model; + +import lombok.Data; + +/** + * @Author: youys + * @Date: 2022/10/17 + * @Description: + */ +@Data +public class Rule { + + private Long id; + private String name; + private String description; +} diff --git a/src/main/java/net/educoder/ecsonar/model/dto/AnalyseDetailDTO.java b/src/main/java/net/educoder/ecsonar/model/dto/AnalyseDetailDTO.java new file mode 100644 index 0000000..05b244f --- /dev/null +++ b/src/main/java/net/educoder/ecsonar/model/dto/AnalyseDetailDTO.java @@ -0,0 +1,16 @@ +package net.educoder.ecsonar.model.dto; + +import lombok.Data; + +/** + * @Author: youys + * @Date: 2022/12/20 + * @Description: + */ +@Data +public class AnalyseDetailDTO { + + private DegreeDTO bug; + private DegreeDTO vulnerability; + private DegreeDTO codeSmall; +} diff --git a/src/main/java/net/educoder/ecsonar/model/dto/AnalyseDetailListDTO.java b/src/main/java/net/educoder/ecsonar/model/dto/AnalyseDetailListDTO.java new file mode 100644 index 0000000..84067ad --- /dev/null +++ b/src/main/java/net/educoder/ecsonar/model/dto/AnalyseDetailListDTO.java @@ -0,0 +1,48 @@ +package net.educoder.ecsonar.model.dto; + + +import lombok.Data; + +import java.util.Date; + +/** + * @Author: youys + * @Date: 2022/9/27 + * @Description: 分析详情列表返回数据 + */ +@Data +public class AnalyseDetailListDTO { + + /** + * 名称 + */ + private String name; + /** + * 描述 + */ + private String description; + /** + * 文件路径 + */ + private String filePath; + /** + * 行号 + */ + private String rowNumber; + /** + * 级别 + */ + private String level; + /** + * 检测时间 + */ + private Date detectTime; + + /** + * 找文件唯一标识 + */ + private String uuid; + + private Integer ruleId; + +} diff --git a/src/main/java/net/educoder/ecsonar/model/dto/CodeDetailDTO.java b/src/main/java/net/educoder/ecsonar/model/dto/CodeDetailDTO.java new file mode 100644 index 0000000..935525a --- /dev/null +++ b/src/main/java/net/educoder/ecsonar/model/dto/CodeDetailDTO.java @@ -0,0 +1,24 @@ +package net.educoder.ecsonar.model.dto; + +import lombok.Data; + +import java.util.List; + +/** + * @Author: youys + * @Date: 2022/10/17 + * @Description: 代码详情 + */ +@Data +public class CodeDetailDTO { + + /** + * 代码 + */ + private List codes; + /** + * 示例代码 + */ + private String example; + +} diff --git a/src/main/java/net/educoder/ecsonar/model/dto/DegreeDTO.java b/src/main/java/net/educoder/ecsonar/model/dto/DegreeDTO.java new file mode 100644 index 0000000..bd194ca --- /dev/null +++ b/src/main/java/net/educoder/ecsonar/model/dto/DegreeDTO.java @@ -0,0 +1,36 @@ +package net.educoder.ecsonar.model.dto; + +import lombok.Data; + +/** + * @Author: youys + * @Date: 2022/12/20 + * @Description: + */ +@Data +public class DegreeDTO { + + private String levelStr = "A"; + + private Integer total = 0; + + /** + * 阻断 + */ + private Integer blocker = 0; + + /** + * 严重 + */ + private Integer critical = 0; + /** + * 主要 + */ + private Integer major = 0; + + /** + * 次要 + */ + private Integer minor = 0; + +} diff --git a/src/main/java/net/educoder/ecsonar/model/dto/FileSourceDTO.java b/src/main/java/net/educoder/ecsonar/model/dto/FileSourceDTO.java new file mode 100644 index 0000000..5881c3d --- /dev/null +++ b/src/main/java/net/educoder/ecsonar/model/dto/FileSourceDTO.java @@ -0,0 +1,16 @@ +package net.educoder.ecsonar.model.dto; + +import lombok.Data; + +/** + * @Author: youys + * @Date: 2022/9/27 + * @Description: + */ +@Data +public class FileSourceDTO { + + private Integer rowNumber; + private String code; + +} diff --git a/src/main/java/net/educoder/ecsonar/model/vo/AnalyseDetailListVO.java b/src/main/java/net/educoder/ecsonar/model/vo/AnalyseDetailListVO.java new file mode 100644 index 0000000..aa7de35 --- /dev/null +++ b/src/main/java/net/educoder/ecsonar/model/vo/AnalyseDetailListVO.java @@ -0,0 +1,36 @@ +package net.educoder.ecsonar.model.vo; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @Author: youys + * @Date: 2022/12/20 + * @Description: 分析详情列表入参 + */ +@Data +public class AnalyseDetailListVO extends PageVO { + + /** + * 类型 + * 1 bug + * 2 漏洞 + * 3 代码规范 + */ + private Integer type; + + /** + * 严重程度 + * all 全部 + */ + private Integer degree; + + + @NotBlank(message = "作业id不能为空") + private String homeworkId; + + @NotBlank(message = "学号不能为空") + private String studentNo; + +} diff --git a/src/main/java/net/educoder/ecsonar/model/vo/AnalyseDetailVO.java b/src/main/java/net/educoder/ecsonar/model/vo/AnalyseDetailVO.java new file mode 100644 index 0000000..1bf4f70 --- /dev/null +++ b/src/main/java/net/educoder/ecsonar/model/vo/AnalyseDetailVO.java @@ -0,0 +1,21 @@ +package net.educoder.ecsonar.model.vo; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @Author: youys + * @Date: 2022/12/20 + * @Description: + */ +@Data +public class AnalyseDetailVO { + + @NotBlank(message = "作业id不能为空") + private String homeworkId; + + @NotBlank(message = "学号不能为空") + private String studentNo; + +} diff --git a/src/main/java/net/educoder/ecsonar/model/vo/CodeDetailVO.java b/src/main/java/net/educoder/ecsonar/model/vo/CodeDetailVO.java new file mode 100644 index 0000000..c892060 --- /dev/null +++ b/src/main/java/net/educoder/ecsonar/model/vo/CodeDetailVO.java @@ -0,0 +1,16 @@ +package net.educoder.ecsonar.model.vo; + +import lombok.Data; + +/** + * @Author: youys + * @Date: 2022/9/27 + * @Description: 代码详情请求参数 + */ +@Data +public class CodeDetailVO { + + + private String uuid; + private Integer ruleId; +} diff --git a/src/main/java/net/educoder/ecsonar/model/vo/PageVO.java b/src/main/java/net/educoder/ecsonar/model/vo/PageVO.java new file mode 100644 index 0000000..d5fa7cb --- /dev/null +++ b/src/main/java/net/educoder/ecsonar/model/vo/PageVO.java @@ -0,0 +1,16 @@ +package net.educoder.ecsonar.model.vo; + +import lombok.Data; + +/** + * @Author: youys + * @Date: 2022/12/20 + * @Description: + */ +@Data +public class PageVO { + + private Integer currentPage = 1; + private Integer pageSize = 20; + +} diff --git a/src/main/java/net/educoder/ecsonar/protobuf/DbCommons.java b/src/main/java/net/educoder/ecsonar/protobuf/DbCommons.java new file mode 100644 index 0000000..e944e6f --- /dev/null +++ b/src/main/java/net/educoder/ecsonar/protobuf/DbCommons.java @@ -0,0 +1,1009 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: db-commons.proto + +package net.educoder.ecsonar.protobuf; + +public final class DbCommons { + private DbCommons() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface TextRangeOrBuilder extends + // @@protoc_insertion_point(interface_extends:sonarqube.db.commons.TextRange) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Start line. Should never be absent
+     * 
+ * + * optional int32 start_line = 1; + * @return Whether the startLine field is set. + */ + boolean hasStartLine(); + /** + *
+     * Start line. Should never be absent
+     * 
+ * + * optional int32 start_line = 1; + * @return The startLine. + */ + int getStartLine(); + + /** + *
+     * End line (inclusive). Absent means it is same as start line
+     * 
+ * + * optional int32 end_line = 2; + * @return Whether the endLine field is set. + */ + boolean hasEndLine(); + /** + *
+     * End line (inclusive). Absent means it is same as start line
+     * 
+ * + * optional int32 end_line = 2; + * @return The endLine. + */ + int getEndLine(); + + /** + *
+     * If absent it means range starts at the first offset of start line
+     * 
+ * + * optional int32 start_offset = 3; + * @return Whether the startOffset field is set. + */ + boolean hasStartOffset(); + /** + *
+     * If absent it means range starts at the first offset of start line
+     * 
+ * + * optional int32 start_offset = 3; + * @return The startOffset. + */ + int getStartOffset(); + + /** + *
+     * If absent it means range ends at the last offset of end line
+     * 
+ * + * optional int32 end_offset = 4; + * @return Whether the endOffset field is set. + */ + boolean hasEndOffset(); + /** + *
+     * If absent it means range ends at the last offset of end line
+     * 
+ * + * optional int32 end_offset = 4; + * @return The endOffset. + */ + int getEndOffset(); + } + /** + *
+   * Lines start at 1 and line offsets start at 0
+   * 
+ * + * Protobuf type {@code sonarqube.db.commons.TextRange} + */ + public static final class TextRange extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:sonarqube.db.commons.TextRange) + TextRangeOrBuilder { + private static final long serialVersionUID = 0L; + // Use TextRange.newBuilder() to construct. + private TextRange(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TextRange() { + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance( + UnusedPrivateParameter unused) { + return new TextRange(); + } + + @Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TextRange( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + bitField0_ |= 0x00000001; + startLine_ = input.readInt32(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + endLine_ = input.readInt32(); + break; + } + case 24: { + bitField0_ |= 0x00000004; + startOffset_ = input.readInt32(); + break; + } + case 32: { + bitField0_ |= 0x00000008; + endOffset_ = input.readInt32(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return net.educoder.ecsonar.protobuf.DbCommons.internal_static_sonarqube_db_commons_TextRange_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return net.educoder.ecsonar.protobuf.DbCommons.internal_static_sonarqube_db_commons_TextRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + TextRange.class, Builder.class); + } + + private int bitField0_; + public static final int START_LINE_FIELD_NUMBER = 1; + private int startLine_; + /** + *
+     * Start line. Should never be absent
+     * 
+ * + * optional int32 start_line = 1; + * @return Whether the startLine field is set. + */ + @Override + public boolean hasStartLine() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+     * Start line. Should never be absent
+     * 
+ * + * optional int32 start_line = 1; + * @return The startLine. + */ + @Override + public int getStartLine() { + return startLine_; + } + + public static final int END_LINE_FIELD_NUMBER = 2; + private int endLine_; + /** + *
+     * End line (inclusive). Absent means it is same as start line
+     * 
+ * + * optional int32 end_line = 2; + * @return Whether the endLine field is set. + */ + @Override + public boolean hasEndLine() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+     * End line (inclusive). Absent means it is same as start line
+     * 
+ * + * optional int32 end_line = 2; + * @return The endLine. + */ + @Override + public int getEndLine() { + return endLine_; + } + + public static final int START_OFFSET_FIELD_NUMBER = 3; + private int startOffset_; + /** + *
+     * If absent it means range starts at the first offset of start line
+     * 
+ * + * optional int32 start_offset = 3; + * @return Whether the startOffset field is set. + */ + @Override + public boolean hasStartOffset() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
+     * If absent it means range starts at the first offset of start line
+     * 
+ * + * optional int32 start_offset = 3; + * @return The startOffset. + */ + @Override + public int getStartOffset() { + return startOffset_; + } + + public static final int END_OFFSET_FIELD_NUMBER = 4; + private int endOffset_; + /** + *
+     * If absent it means range ends at the last offset of end line
+     * 
+ * + * optional int32 end_offset = 4; + * @return Whether the endOffset field is set. + */ + @Override + public boolean hasEndOffset() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
+     * If absent it means range ends at the last offset of end line
+     * 
+ * + * optional int32 end_offset = 4; + * @return The endOffset. + */ + @Override + public int getEndOffset() { + return endOffset_; + } + + private byte memoizedIsInitialized = -1; + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(1, startLine_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt32(2, endLine_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeInt32(3, startOffset_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeInt32(4, endOffset_); + } + unknownFields.writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, startLine_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, endLine_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, startOffset_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, endOffset_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof TextRange)) { + return super.equals(obj); + } + TextRange other = (TextRange) obj; + + if (hasStartLine() != other.hasStartLine()) return false; + if (hasStartLine()) { + if (getStartLine() + != other.getStartLine()) return false; + } + if (hasEndLine() != other.hasEndLine()) return false; + if (hasEndLine()) { + if (getEndLine() + != other.getEndLine()) return false; + } + if (hasStartOffset() != other.hasStartOffset()) return false; + if (hasStartOffset()) { + if (getStartOffset() + != other.getStartOffset()) return false; + } + if (hasEndOffset() != other.hasEndOffset()) return false; + if (hasEndOffset()) { + if (getEndOffset() + != other.getEndOffset()) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasStartLine()) { + hash = (37 * hash) + START_LINE_FIELD_NUMBER; + hash = (53 * hash) + getStartLine(); + } + if (hasEndLine()) { + hash = (37 * hash) + END_LINE_FIELD_NUMBER; + hash = (53 * hash) + getEndLine(); + } + if (hasStartOffset()) { + hash = (37 * hash) + START_OFFSET_FIELD_NUMBER; + hash = (53 * hash) + getStartOffset(); + } + if (hasEndOffset()) { + hash = (37 * hash) + END_OFFSET_FIELD_NUMBER; + hash = (53 * hash) + getEndOffset(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static TextRange parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static TextRange parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static TextRange parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static TextRange parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static TextRange parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static TextRange parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static TextRange parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static TextRange parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static TextRange parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static TextRange parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static TextRange parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static TextRange parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(TextRange prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType( + BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * Lines start at 1 and line offsets start at 0
+     * 
+ * + * Protobuf type {@code sonarqube.db.commons.TextRange} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:sonarqube.db.commons.TextRange) + TextRangeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return net.educoder.ecsonar.protobuf.DbCommons.internal_static_sonarqube_db_commons_TextRange_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return net.educoder.ecsonar.protobuf.DbCommons.internal_static_sonarqube_db_commons_TextRange_fieldAccessorTable + .ensureFieldAccessorsInitialized( + TextRange.class, Builder.class); + } + + // Construct using net.educoder.ecsonar.protobuf.DbCommons.TextRange.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @Override + public Builder clear() { + super.clear(); + startLine_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + endLine_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + startOffset_ = 0; + bitField0_ = (bitField0_ & ~0x00000004); + endOffset_ = 0; + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return net.educoder.ecsonar.protobuf.DbCommons.internal_static_sonarqube_db_commons_TextRange_descriptor; + } + + @Override + public TextRange getDefaultInstanceForType() { + return TextRange.getDefaultInstance(); + } + + @Override + public TextRange build() { + TextRange result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public TextRange buildPartial() { + TextRange result = new TextRange(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.startLine_ = startLine_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.endLine_ = endLine_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.startOffset_ = startOffset_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.endOffset_ = endOffset_; + to_bitField0_ |= 0x00000008; + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @Override + public Builder clone() { + return super.clone(); + } + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.setField(field, value); + } + @Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return super.setRepeatedField(field, index, value); + } + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.addRepeatedField(field, value); + } + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof TextRange) { + return mergeFrom((TextRange)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(TextRange other) { + if (other == TextRange.getDefaultInstance()) return this; + if (other.hasStartLine()) { + setStartLine(other.getStartLine()); + } + if (other.hasEndLine()) { + setEndLine(other.getEndLine()); + } + if (other.hasStartOffset()) { + setStartOffset(other.getStartOffset()); + } + if (other.hasEndOffset()) { + setEndOffset(other.getEndOffset()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + TextRange parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (TextRange) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int startLine_ ; + /** + *
+       * Start line. Should never be absent
+       * 
+ * + * optional int32 start_line = 1; + * @return Whether the startLine field is set. + */ + @Override + public boolean hasStartLine() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+       * Start line. Should never be absent
+       * 
+ * + * optional int32 start_line = 1; + * @return The startLine. + */ + @Override + public int getStartLine() { + return startLine_; + } + /** + *
+       * Start line. Should never be absent
+       * 
+ * + * optional int32 start_line = 1; + * @param value The startLine to set. + * @return This builder for chaining. + */ + public Builder setStartLine(int value) { + bitField0_ |= 0x00000001; + startLine_ = value; + onChanged(); + return this; + } + /** + *
+       * Start line. Should never be absent
+       * 
+ * + * optional int32 start_line = 1; + * @return This builder for chaining. + */ + public Builder clearStartLine() { + bitField0_ = (bitField0_ & ~0x00000001); + startLine_ = 0; + onChanged(); + return this; + } + + private int endLine_ ; + /** + *
+       * End line (inclusive). Absent means it is same as start line
+       * 
+ * + * optional int32 end_line = 2; + * @return Whether the endLine field is set. + */ + @Override + public boolean hasEndLine() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+       * End line (inclusive). Absent means it is same as start line
+       * 
+ * + * optional int32 end_line = 2; + * @return The endLine. + */ + @Override + public int getEndLine() { + return endLine_; + } + /** + *
+       * End line (inclusive). Absent means it is same as start line
+       * 
+ * + * optional int32 end_line = 2; + * @param value The endLine to set. + * @return This builder for chaining. + */ + public Builder setEndLine(int value) { + bitField0_ |= 0x00000002; + endLine_ = value; + onChanged(); + return this; + } + /** + *
+       * End line (inclusive). Absent means it is same as start line
+       * 
+ * + * optional int32 end_line = 2; + * @return This builder for chaining. + */ + public Builder clearEndLine() { + bitField0_ = (bitField0_ & ~0x00000002); + endLine_ = 0; + onChanged(); + return this; + } + + private int startOffset_ ; + /** + *
+       * If absent it means range starts at the first offset of start line
+       * 
+ * + * optional int32 start_offset = 3; + * @return Whether the startOffset field is set. + */ + @Override + public boolean hasStartOffset() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
+       * If absent it means range starts at the first offset of start line
+       * 
+ * + * optional int32 start_offset = 3; + * @return The startOffset. + */ + @Override + public int getStartOffset() { + return startOffset_; + } + /** + *
+       * If absent it means range starts at the first offset of start line
+       * 
+ * + * optional int32 start_offset = 3; + * @param value The startOffset to set. + * @return This builder for chaining. + */ + public Builder setStartOffset(int value) { + bitField0_ |= 0x00000004; + startOffset_ = value; + onChanged(); + return this; + } + /** + *
+       * If absent it means range starts at the first offset of start line
+       * 
+ * + * optional int32 start_offset = 3; + * @return This builder for chaining. + */ + public Builder clearStartOffset() { + bitField0_ = (bitField0_ & ~0x00000004); + startOffset_ = 0; + onChanged(); + return this; + } + + private int endOffset_ ; + /** + *
+       * If absent it means range ends at the last offset of end line
+       * 
+ * + * optional int32 end_offset = 4; + * @return Whether the endOffset field is set. + */ + @Override + public boolean hasEndOffset() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + *
+       * If absent it means range ends at the last offset of end line
+       * 
+ * + * optional int32 end_offset = 4; + * @return The endOffset. + */ + @Override + public int getEndOffset() { + return endOffset_; + } + /** + *
+       * If absent it means range ends at the last offset of end line
+       * 
+ * + * optional int32 end_offset = 4; + * @param value The endOffset to set. + * @return This builder for chaining. + */ + public Builder setEndOffset(int value) { + bitField0_ |= 0x00000008; + endOffset_ = value; + onChanged(); + return this; + } + /** + *
+       * If absent it means range ends at the last offset of end line
+       * 
+ * + * optional int32 end_offset = 4; + * @return This builder for chaining. + */ + public Builder clearEndOffset() { + bitField0_ = (bitField0_ & ~0x00000008); + endOffset_ = 0; + onChanged(); + return this; + } + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:sonarqube.db.commons.TextRange) + } + + // @@protoc_insertion_point(class_scope:sonarqube.db.commons.TextRange) + private static final TextRange DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new TextRange(); + } + + public static TextRange getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @Deprecated + public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @Override + public TextRange parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TextRange(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public TextRange getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_sonarqube_db_commons_TextRange_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_sonarqube_db_commons_TextRange_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + String[] descriptorData = { + "\n\020db-commons.proto\022\024sonarqube.db.commons" + + "\"[\n\tTextRange\022\022\n\nstart_line\030\001 \001(\005\022\020\n\010end" + + "_line\030\002 \001(\005\022\024\n\014start_offset\030\003 \001(\005\022\022\n\nend" + + "_offset\030\004 \001(\005B!\n\035net.educoder.ecsonar.pr" + + "otobufH\001" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_sonarqube_db_commons_TextRange_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_sonarqube_db_commons_TextRange_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_sonarqube_db_commons_TextRange_descriptor, + new String[] { "StartLine", "EndLine", "StartOffset", "EndOffset", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/main/java/net/educoder/ecsonar/protobuf/DbFileSources.java b/src/main/java/net/educoder/ecsonar/protobuf/DbFileSources.java new file mode 100644 index 0000000..8f070eb --- /dev/null +++ b/src/main/java/net/educoder/ecsonar/protobuf/DbFileSources.java @@ -0,0 +1,4663 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: db-file-sources.proto + +package net.educoder.ecsonar.protobuf; + +public final class DbFileSources { + private DbFileSources() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface LineOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.sonar.server.source.db.Line) + com.google.protobuf.MessageOrBuilder { + + /** + * optional int32 line = 1; + * @return Whether the line field is set. + */ + boolean hasLine(); + /** + * optional int32 line = 1; + * @return The line. + */ + int getLine(); + + /** + * optional string source = 2; + * @return Whether the source field is set. + */ + boolean hasSource(); + /** + * optional string source = 2; + * @return The source. + */ + String getSource(); + /** + * optional string source = 2; + * @return The bytes for source. + */ + com.google.protobuf.ByteString + getSourceBytes(); + + /** + *
+     * SCM
+     * 
+ * + * optional string scm_revision = 3; + * @return Whether the scmRevision field is set. + */ + boolean hasScmRevision(); + /** + *
+     * SCM
+     * 
+ * + * optional string scm_revision = 3; + * @return The scmRevision. + */ + String getScmRevision(); + /** + *
+     * SCM
+     * 
+ * + * optional string scm_revision = 3; + * @return The bytes for scmRevision. + */ + com.google.protobuf.ByteString + getScmRevisionBytes(); + + /** + * optional string scm_author = 4; + * @return Whether the scmAuthor field is set. + */ + boolean hasScmAuthor(); + /** + * optional string scm_author = 4; + * @return The scmAuthor. + */ + String getScmAuthor(); + /** + * optional string scm_author = 4; + * @return The bytes for scmAuthor. + */ + com.google.protobuf.ByteString + getScmAuthorBytes(); + + /** + * optional int64 scm_date = 5; + * @return Whether the scmDate field is set. + */ + boolean hasScmDate(); + /** + * optional int64 scm_date = 5; + * @return The scmDate. + */ + long getScmDate(); + + /** + *
+     * Deprecated fields in 6.2 (has been deprecated when merging coverage into a single metric)
+     * They are still used to read coverage info from sources that have not be re-analyzed
+     * 
+ * + * optional int32 deprecated_ut_line_hits = 6; + * @return Whether the deprecatedUtLineHits field is set. + */ + boolean hasDeprecatedUtLineHits(); + /** + *
+     * Deprecated fields in 6.2 (has been deprecated when merging coverage into a single metric)
+     * They are still used to read coverage info from sources that have not be re-analyzed
+     * 
+ * + * optional int32 deprecated_ut_line_hits = 6; + * @return The deprecatedUtLineHits. + */ + int getDeprecatedUtLineHits(); + + /** + * optional int32 deprecated_ut_conditions = 7; + * @return Whether the deprecatedUtConditions field is set. + */ + boolean hasDeprecatedUtConditions(); + /** + * optional int32 deprecated_ut_conditions = 7; + * @return The deprecatedUtConditions. + */ + int getDeprecatedUtConditions(); + + /** + * optional int32 deprecated_ut_covered_conditions = 8; + * @return Whether the deprecatedUtCoveredConditions field is set. + */ + boolean hasDeprecatedUtCoveredConditions(); + /** + * optional int32 deprecated_ut_covered_conditions = 8; + * @return The deprecatedUtCoveredConditions. + */ + int getDeprecatedUtCoveredConditions(); + + /** + * optional int32 deprecated_it_line_hits = 9; + * @return Whether the deprecatedItLineHits field is set. + */ + boolean hasDeprecatedItLineHits(); + /** + * optional int32 deprecated_it_line_hits = 9; + * @return The deprecatedItLineHits. + */ + int getDeprecatedItLineHits(); + + /** + * optional int32 deprecated_it_conditions = 10; + * @return Whether the deprecatedItConditions field is set. + */ + boolean hasDeprecatedItConditions(); + /** + * optional int32 deprecated_it_conditions = 10; + * @return The deprecatedItConditions. + */ + int getDeprecatedItConditions(); + + /** + * optional int32 deprecated_it_covered_conditions = 11; + * @return Whether the deprecatedItCoveredConditions field is set. + */ + boolean hasDeprecatedItCoveredConditions(); + /** + * optional int32 deprecated_it_covered_conditions = 11; + * @return The deprecatedItCoveredConditions. + */ + int getDeprecatedItCoveredConditions(); + + /** + * optional int32 deprecated_overall_line_hits = 12; + * @return Whether the deprecatedOverallLineHits field is set. + */ + boolean hasDeprecatedOverallLineHits(); + /** + * optional int32 deprecated_overall_line_hits = 12; + * @return The deprecatedOverallLineHits. + */ + int getDeprecatedOverallLineHits(); + + /** + * optional int32 deprecated_overall_conditions = 13; + * @return Whether the deprecatedOverallConditions field is set. + */ + boolean hasDeprecatedOverallConditions(); + /** + * optional int32 deprecated_overall_conditions = 13; + * @return The deprecatedOverallConditions. + */ + int getDeprecatedOverallConditions(); + + /** + * optional int32 deprecated_overall_covered_conditions = 14; + * @return Whether the deprecatedOverallCoveredConditions field is set. + */ + boolean hasDeprecatedOverallCoveredConditions(); + /** + * optional int32 deprecated_overall_covered_conditions = 14; + * @return The deprecatedOverallCoveredConditions. + */ + int getDeprecatedOverallCoveredConditions(); + + /** + * optional string highlighting = 15; + * @return Whether the highlighting field is set. + */ + boolean hasHighlighting(); + /** + * optional string highlighting = 15; + * @return The highlighting. + */ + String getHighlighting(); + /** + * optional string highlighting = 15; + * @return The bytes for highlighting. + */ + com.google.protobuf.ByteString + getHighlightingBytes(); + + /** + * optional string symbols = 16; + * @return Whether the symbols field is set. + */ + boolean hasSymbols(); + /** + * optional string symbols = 16; + * @return The symbols. + */ + String getSymbols(); + /** + * optional string symbols = 16; + * @return The bytes for symbols. + */ + com.google.protobuf.ByteString + getSymbolsBytes(); + + /** + * repeated int32 duplication = 17 [packed = true]; + * @return A list containing the duplication. + */ + java.util.List getDuplicationList(); + /** + * repeated int32 duplication = 17 [packed = true]; + * @return The count of duplication. + */ + int getDuplicationCount(); + /** + * repeated int32 duplication = 17 [packed = true]; + * @param index The index of the element to return. + * @return The duplication at the given index. + */ + int getDuplication(int index); + + /** + *
+     * coverage info (since 6.2)
+     * 
+ * + * optional int32 line_hits = 18; + * @return Whether the lineHits field is set. + */ + boolean hasLineHits(); + /** + *
+     * coverage info (since 6.2)
+     * 
+ * + * optional int32 line_hits = 18; + * @return The lineHits. + */ + int getLineHits(); + + /** + * optional int32 conditions = 19; + * @return Whether the conditions field is set. + */ + boolean hasConditions(); + /** + * optional int32 conditions = 19; + * @return The conditions. + */ + int getConditions(); + + /** + * optional int32 covered_conditions = 20; + * @return Whether the coveredConditions field is set. + */ + boolean hasCoveredConditions(); + /** + * optional int32 covered_conditions = 20; + * @return The coveredConditions. + */ + int getCoveredConditions(); + + /** + * optional bool is_new_line = 21; + * @return Whether the isNewLine field is set. + */ + boolean hasIsNewLine(); + /** + * optional bool is_new_line = 21; + * @return The isNewLine. + */ + boolean getIsNewLine(); + } + /** + * Protobuf type {@code org.sonar.server.source.db.Line} + */ + public static final class Line extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:org.sonar.server.source.db.Line) + LineOrBuilder { + private static final long serialVersionUID = 0L; + // Use Line.newBuilder() to construct. + private Line(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Line() { + source_ = ""; + scmRevision_ = ""; + scmAuthor_ = ""; + highlighting_ = ""; + symbols_ = ""; + duplication_ = emptyIntList(); + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance( + UnusedPrivateParameter unused) { + return new Line(); + } + + @Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Line( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + bitField0_ |= 0x00000001; + line_ = input.readInt32(); + break; + } + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000002; + source_ = bs; + break; + } + case 26: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000004; + scmRevision_ = bs; + break; + } + case 34: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000008; + scmAuthor_ = bs; + break; + } + case 40: { + bitField0_ |= 0x00000010; + scmDate_ = input.readInt64(); + break; + } + case 48: { + bitField0_ |= 0x00000020; + deprecatedUtLineHits_ = input.readInt32(); + break; + } + case 56: { + bitField0_ |= 0x00000040; + deprecatedUtConditions_ = input.readInt32(); + break; + } + case 64: { + bitField0_ |= 0x00000080; + deprecatedUtCoveredConditions_ = input.readInt32(); + break; + } + case 72: { + bitField0_ |= 0x00000100; + deprecatedItLineHits_ = input.readInt32(); + break; + } + case 80: { + bitField0_ |= 0x00000200; + deprecatedItConditions_ = input.readInt32(); + break; + } + case 88: { + bitField0_ |= 0x00000400; + deprecatedItCoveredConditions_ = input.readInt32(); + break; + } + case 96: { + bitField0_ |= 0x00000800; + deprecatedOverallLineHits_ = input.readInt32(); + break; + } + case 104: { + bitField0_ |= 0x00001000; + deprecatedOverallConditions_ = input.readInt32(); + break; + } + case 112: { + bitField0_ |= 0x00002000; + deprecatedOverallCoveredConditions_ = input.readInt32(); + break; + } + case 122: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00004000; + highlighting_ = bs; + break; + } + case 130: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00008000; + symbols_ = bs; + break; + } + case 136: { + if (!((mutable_bitField0_ & 0x00010000) != 0)) { + duplication_ = newIntList(); + mutable_bitField0_ |= 0x00010000; + } + duplication_.addInt(input.readInt32()); + break; + } + case 138: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00010000) != 0) && input.getBytesUntilLimit() > 0) { + duplication_ = newIntList(); + mutable_bitField0_ |= 0x00010000; + } + while (input.getBytesUntilLimit() > 0) { + duplication_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } + case 144: { + bitField0_ |= 0x00010000; + lineHits_ = input.readInt32(); + break; + } + case 152: { + bitField0_ |= 0x00020000; + conditions_ = input.readInt32(); + break; + } + case 160: { + bitField0_ |= 0x00040000; + coveredConditions_ = input.readInt32(); + break; + } + case 168: { + bitField0_ |= 0x00080000; + isNewLine_ = input.readBool(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00010000) != 0)) { + duplication_.makeImmutable(); // C + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return net.educoder.ecsonar.protobuf.DbFileSources.internal_static_org_sonar_server_source_db_Line_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return net.educoder.ecsonar.protobuf.DbFileSources.internal_static_org_sonar_server_source_db_Line_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Line.class, Builder.class); + } + + private int bitField0_; + public static final int LINE_FIELD_NUMBER = 1; + private int line_; + /** + * optional int32 line = 1; + * @return Whether the line field is set. + */ + @Override + public boolean hasLine() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 line = 1; + * @return The line. + */ + @Override + public int getLine() { + return line_; + } + + public static final int SOURCE_FIELD_NUMBER = 2; + private volatile Object source_; + /** + * optional string source = 2; + * @return Whether the source field is set. + */ + @Override + public boolean hasSource() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional string source = 2; + * @return The source. + */ + @Override + public String getSource() { + Object ref = source_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + source_ = s; + } + return s; + } + } + /** + * optional string source = 2; + * @return The bytes for source. + */ + @Override + public com.google.protobuf.ByteString + getSourceBytes() { + Object ref = source_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + source_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SCM_REVISION_FIELD_NUMBER = 3; + private volatile Object scmRevision_; + /** + *
+     * SCM
+     * 
+ * + * optional string scm_revision = 3; + * @return Whether the scmRevision field is set. + */ + @Override + public boolean hasScmRevision() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
+     * SCM
+     * 
+ * + * optional string scm_revision = 3; + * @return The scmRevision. + */ + @Override + public String getScmRevision() { + Object ref = scmRevision_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + scmRevision_ = s; + } + return s; + } + } + /** + *
+     * SCM
+     * 
+ * + * optional string scm_revision = 3; + * @return The bytes for scmRevision. + */ + @Override + public com.google.protobuf.ByteString + getScmRevisionBytes() { + Object ref = scmRevision_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + scmRevision_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SCM_AUTHOR_FIELD_NUMBER = 4; + private volatile Object scmAuthor_; + /** + * optional string scm_author = 4; + * @return Whether the scmAuthor field is set. + */ + @Override + public boolean hasScmAuthor() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * optional string scm_author = 4; + * @return The scmAuthor. + */ + @Override + public String getScmAuthor() { + Object ref = scmAuthor_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + scmAuthor_ = s; + } + return s; + } + } + /** + * optional string scm_author = 4; + * @return The bytes for scmAuthor. + */ + @Override + public com.google.protobuf.ByteString + getScmAuthorBytes() { + Object ref = scmAuthor_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + scmAuthor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SCM_DATE_FIELD_NUMBER = 5; + private long scmDate_; + /** + * optional int64 scm_date = 5; + * @return Whether the scmDate field is set. + */ + @Override + public boolean hasScmDate() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * optional int64 scm_date = 5; + * @return The scmDate. + */ + @Override + public long getScmDate() { + return scmDate_; + } + + public static final int DEPRECATED_UT_LINE_HITS_FIELD_NUMBER = 6; + private int deprecatedUtLineHits_; + /** + *
+     * Deprecated fields in 6.2 (has been deprecated when merging coverage into a single metric)
+     * They are still used to read coverage info from sources that have not be re-analyzed
+     * 
+ * + * optional int32 deprecated_ut_line_hits = 6; + * @return Whether the deprecatedUtLineHits field is set. + */ + @Override + public boolean hasDeprecatedUtLineHits() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + *
+     * Deprecated fields in 6.2 (has been deprecated when merging coverage into a single metric)
+     * They are still used to read coverage info from sources that have not be re-analyzed
+     * 
+ * + * optional int32 deprecated_ut_line_hits = 6; + * @return The deprecatedUtLineHits. + */ + @Override + public int getDeprecatedUtLineHits() { + return deprecatedUtLineHits_; + } + + public static final int DEPRECATED_UT_CONDITIONS_FIELD_NUMBER = 7; + private int deprecatedUtConditions_; + /** + * optional int32 deprecated_ut_conditions = 7; + * @return Whether the deprecatedUtConditions field is set. + */ + @Override + public boolean hasDeprecatedUtConditions() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * optional int32 deprecated_ut_conditions = 7; + * @return The deprecatedUtConditions. + */ + @Override + public int getDeprecatedUtConditions() { + return deprecatedUtConditions_; + } + + public static final int DEPRECATED_UT_COVERED_CONDITIONS_FIELD_NUMBER = 8; + private int deprecatedUtCoveredConditions_; + /** + * optional int32 deprecated_ut_covered_conditions = 8; + * @return Whether the deprecatedUtCoveredConditions field is set. + */ + @Override + public boolean hasDeprecatedUtCoveredConditions() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * optional int32 deprecated_ut_covered_conditions = 8; + * @return The deprecatedUtCoveredConditions. + */ + @Override + public int getDeprecatedUtCoveredConditions() { + return deprecatedUtCoveredConditions_; + } + + public static final int DEPRECATED_IT_LINE_HITS_FIELD_NUMBER = 9; + private int deprecatedItLineHits_; + /** + * optional int32 deprecated_it_line_hits = 9; + * @return Whether the deprecatedItLineHits field is set. + */ + @Override + public boolean hasDeprecatedItLineHits() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * optional int32 deprecated_it_line_hits = 9; + * @return The deprecatedItLineHits. + */ + @Override + public int getDeprecatedItLineHits() { + return deprecatedItLineHits_; + } + + public static final int DEPRECATED_IT_CONDITIONS_FIELD_NUMBER = 10; + private int deprecatedItConditions_; + /** + * optional int32 deprecated_it_conditions = 10; + * @return Whether the deprecatedItConditions field is set. + */ + @Override + public boolean hasDeprecatedItConditions() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + * optional int32 deprecated_it_conditions = 10; + * @return The deprecatedItConditions. + */ + @Override + public int getDeprecatedItConditions() { + return deprecatedItConditions_; + } + + public static final int DEPRECATED_IT_COVERED_CONDITIONS_FIELD_NUMBER = 11; + private int deprecatedItCoveredConditions_; + /** + * optional int32 deprecated_it_covered_conditions = 11; + * @return Whether the deprecatedItCoveredConditions field is set. + */ + @Override + public boolean hasDeprecatedItCoveredConditions() { + return ((bitField0_ & 0x00000400) != 0); + } + /** + * optional int32 deprecated_it_covered_conditions = 11; + * @return The deprecatedItCoveredConditions. + */ + @Override + public int getDeprecatedItCoveredConditions() { + return deprecatedItCoveredConditions_; + } + + public static final int DEPRECATED_OVERALL_LINE_HITS_FIELD_NUMBER = 12; + private int deprecatedOverallLineHits_; + /** + * optional int32 deprecated_overall_line_hits = 12; + * @return Whether the deprecatedOverallLineHits field is set. + */ + @Override + public boolean hasDeprecatedOverallLineHits() { + return ((bitField0_ & 0x00000800) != 0); + } + /** + * optional int32 deprecated_overall_line_hits = 12; + * @return The deprecatedOverallLineHits. + */ + @Override + public int getDeprecatedOverallLineHits() { + return deprecatedOverallLineHits_; + } + + public static final int DEPRECATED_OVERALL_CONDITIONS_FIELD_NUMBER = 13; + private int deprecatedOverallConditions_; + /** + * optional int32 deprecated_overall_conditions = 13; + * @return Whether the deprecatedOverallConditions field is set. + */ + @Override + public boolean hasDeprecatedOverallConditions() { + return ((bitField0_ & 0x00001000) != 0); + } + /** + * optional int32 deprecated_overall_conditions = 13; + * @return The deprecatedOverallConditions. + */ + @Override + public int getDeprecatedOverallConditions() { + return deprecatedOverallConditions_; + } + + public static final int DEPRECATED_OVERALL_COVERED_CONDITIONS_FIELD_NUMBER = 14; + private int deprecatedOverallCoveredConditions_; + /** + * optional int32 deprecated_overall_covered_conditions = 14; + * @return Whether the deprecatedOverallCoveredConditions field is set. + */ + @Override + public boolean hasDeprecatedOverallCoveredConditions() { + return ((bitField0_ & 0x00002000) != 0); + } + /** + * optional int32 deprecated_overall_covered_conditions = 14; + * @return The deprecatedOverallCoveredConditions. + */ + @Override + public int getDeprecatedOverallCoveredConditions() { + return deprecatedOverallCoveredConditions_; + } + + public static final int HIGHLIGHTING_FIELD_NUMBER = 15; + private volatile Object highlighting_; + /** + * optional string highlighting = 15; + * @return Whether the highlighting field is set. + */ + @Override + public boolean hasHighlighting() { + return ((bitField0_ & 0x00004000) != 0); + } + /** + * optional string highlighting = 15; + * @return The highlighting. + */ + @Override + public String getHighlighting() { + Object ref = highlighting_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + highlighting_ = s; + } + return s; + } + } + /** + * optional string highlighting = 15; + * @return The bytes for highlighting. + */ + @Override + public com.google.protobuf.ByteString + getHighlightingBytes() { + Object ref = highlighting_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + highlighting_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SYMBOLS_FIELD_NUMBER = 16; + private volatile Object symbols_; + /** + * optional string symbols = 16; + * @return Whether the symbols field is set. + */ + @Override + public boolean hasSymbols() { + return ((bitField0_ & 0x00008000) != 0); + } + /** + * optional string symbols = 16; + * @return The symbols. + */ + @Override + public String getSymbols() { + Object ref = symbols_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + symbols_ = s; + } + return s; + } + } + /** + * optional string symbols = 16; + * @return The bytes for symbols. + */ + @Override + public com.google.protobuf.ByteString + getSymbolsBytes() { + Object ref = symbols_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + symbols_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DUPLICATION_FIELD_NUMBER = 17; + private com.google.protobuf.Internal.IntList duplication_; + /** + * repeated int32 duplication = 17 [packed = true]; + * @return A list containing the duplication. + */ + @Override + public java.util.List + getDuplicationList() { + return duplication_; + } + /** + * repeated int32 duplication = 17 [packed = true]; + * @return The count of duplication. + */ + public int getDuplicationCount() { + return duplication_.size(); + } + /** + * repeated int32 duplication = 17 [packed = true]; + * @param index The index of the element to return. + * @return The duplication at the given index. + */ + public int getDuplication(int index) { + return duplication_.getInt(index); + } + private int duplicationMemoizedSerializedSize = -1; + + public static final int LINE_HITS_FIELD_NUMBER = 18; + private int lineHits_; + /** + *
+     * coverage info (since 6.2)
+     * 
+ * + * optional int32 line_hits = 18; + * @return Whether the lineHits field is set. + */ + @Override + public boolean hasLineHits() { + return ((bitField0_ & 0x00010000) != 0); + } + /** + *
+     * coverage info (since 6.2)
+     * 
+ * + * optional int32 line_hits = 18; + * @return The lineHits. + */ + @Override + public int getLineHits() { + return lineHits_; + } + + public static final int CONDITIONS_FIELD_NUMBER = 19; + private int conditions_; + /** + * optional int32 conditions = 19; + * @return Whether the conditions field is set. + */ + @Override + public boolean hasConditions() { + return ((bitField0_ & 0x00020000) != 0); + } + /** + * optional int32 conditions = 19; + * @return The conditions. + */ + @Override + public int getConditions() { + return conditions_; + } + + public static final int COVERED_CONDITIONS_FIELD_NUMBER = 20; + private int coveredConditions_; + /** + * optional int32 covered_conditions = 20; + * @return Whether the coveredConditions field is set. + */ + @Override + public boolean hasCoveredConditions() { + return ((bitField0_ & 0x00040000) != 0); + } + /** + * optional int32 covered_conditions = 20; + * @return The coveredConditions. + */ + @Override + public int getCoveredConditions() { + return coveredConditions_; + } + + public static final int IS_NEW_LINE_FIELD_NUMBER = 21; + private boolean isNewLine_; + /** + * optional bool is_new_line = 21; + * @return Whether the isNewLine field is set. + */ + @Override + public boolean hasIsNewLine() { + return ((bitField0_ & 0x00080000) != 0); + } + /** + * optional bool is_new_line = 21; + * @return The isNewLine. + */ + @Override + public boolean getIsNewLine() { + return isNewLine_; + } + + private byte memoizedIsInitialized = -1; + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(1, line_); + } + if (((bitField0_ & 0x00000002) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, source_); + } + if (((bitField0_ & 0x00000004) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, scmRevision_); + } + if (((bitField0_ & 0x00000008) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, scmAuthor_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeInt64(5, scmDate_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeInt32(6, deprecatedUtLineHits_); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeInt32(7, deprecatedUtConditions_); + } + if (((bitField0_ & 0x00000080) != 0)) { + output.writeInt32(8, deprecatedUtCoveredConditions_); + } + if (((bitField0_ & 0x00000100) != 0)) { + output.writeInt32(9, deprecatedItLineHits_); + } + if (((bitField0_ & 0x00000200) != 0)) { + output.writeInt32(10, deprecatedItConditions_); + } + if (((bitField0_ & 0x00000400) != 0)) { + output.writeInt32(11, deprecatedItCoveredConditions_); + } + if (((bitField0_ & 0x00000800) != 0)) { + output.writeInt32(12, deprecatedOverallLineHits_); + } + if (((bitField0_ & 0x00001000) != 0)) { + output.writeInt32(13, deprecatedOverallConditions_); + } + if (((bitField0_ & 0x00002000) != 0)) { + output.writeInt32(14, deprecatedOverallCoveredConditions_); + } + if (((bitField0_ & 0x00004000) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 15, highlighting_); + } + if (((bitField0_ & 0x00008000) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 16, symbols_); + } + if (getDuplicationList().size() > 0) { + output.writeUInt32NoTag(138); + output.writeUInt32NoTag(duplicationMemoizedSerializedSize); + } + for (int i = 0; i < duplication_.size(); i++) { + output.writeInt32NoTag(duplication_.getInt(i)); + } + if (((bitField0_ & 0x00010000) != 0)) { + output.writeInt32(18, lineHits_); + } + if (((bitField0_ & 0x00020000) != 0)) { + output.writeInt32(19, conditions_); + } + if (((bitField0_ & 0x00040000) != 0)) { + output.writeInt32(20, coveredConditions_); + } + if (((bitField0_ & 0x00080000) != 0)) { + output.writeBool(21, isNewLine_); + } + unknownFields.writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, line_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, source_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, scmRevision_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, scmAuthor_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(5, scmDate_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(6, deprecatedUtLineHits_); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(7, deprecatedUtConditions_); + } + if (((bitField0_ & 0x00000080) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(8, deprecatedUtCoveredConditions_); + } + if (((bitField0_ & 0x00000100) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(9, deprecatedItLineHits_); + } + if (((bitField0_ & 0x00000200) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(10, deprecatedItConditions_); + } + if (((bitField0_ & 0x00000400) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(11, deprecatedItCoveredConditions_); + } + if (((bitField0_ & 0x00000800) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(12, deprecatedOverallLineHits_); + } + if (((bitField0_ & 0x00001000) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(13, deprecatedOverallConditions_); + } + if (((bitField0_ & 0x00002000) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(14, deprecatedOverallCoveredConditions_); + } + if (((bitField0_ & 0x00004000) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, highlighting_); + } + if (((bitField0_ & 0x00008000) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(16, symbols_); + } + { + int dataSize = 0; + for (int i = 0; i < duplication_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(duplication_.getInt(i)); + } + size += dataSize; + if (!getDuplicationList().isEmpty()) { + size += 2; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + duplicationMemoizedSerializedSize = dataSize; + } + if (((bitField0_ & 0x00010000) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(18, lineHits_); + } + if (((bitField0_ & 0x00020000) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(19, conditions_); + } + if (((bitField0_ & 0x00040000) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(20, coveredConditions_); + } + if (((bitField0_ & 0x00080000) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(21, isNewLine_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Line)) { + return super.equals(obj); + } + Line other = (Line) obj; + + if (hasLine() != other.hasLine()) return false; + if (hasLine()) { + if (getLine() + != other.getLine()) return false; + } + if (hasSource() != other.hasSource()) return false; + if (hasSource()) { + if (!getSource() + .equals(other.getSource())) return false; + } + if (hasScmRevision() != other.hasScmRevision()) return false; + if (hasScmRevision()) { + if (!getScmRevision() + .equals(other.getScmRevision())) return false; + } + if (hasScmAuthor() != other.hasScmAuthor()) return false; + if (hasScmAuthor()) { + if (!getScmAuthor() + .equals(other.getScmAuthor())) return false; + } + if (hasScmDate() != other.hasScmDate()) return false; + if (hasScmDate()) { + if (getScmDate() + != other.getScmDate()) return false; + } + if (hasDeprecatedUtLineHits() != other.hasDeprecatedUtLineHits()) return false; + if (hasDeprecatedUtLineHits()) { + if (getDeprecatedUtLineHits() + != other.getDeprecatedUtLineHits()) return false; + } + if (hasDeprecatedUtConditions() != other.hasDeprecatedUtConditions()) return false; + if (hasDeprecatedUtConditions()) { + if (getDeprecatedUtConditions() + != other.getDeprecatedUtConditions()) return false; + } + if (hasDeprecatedUtCoveredConditions() != other.hasDeprecatedUtCoveredConditions()) return false; + if (hasDeprecatedUtCoveredConditions()) { + if (getDeprecatedUtCoveredConditions() + != other.getDeprecatedUtCoveredConditions()) return false; + } + if (hasDeprecatedItLineHits() != other.hasDeprecatedItLineHits()) return false; + if (hasDeprecatedItLineHits()) { + if (getDeprecatedItLineHits() + != other.getDeprecatedItLineHits()) return false; + } + if (hasDeprecatedItConditions() != other.hasDeprecatedItConditions()) return false; + if (hasDeprecatedItConditions()) { + if (getDeprecatedItConditions() + != other.getDeprecatedItConditions()) return false; + } + if (hasDeprecatedItCoveredConditions() != other.hasDeprecatedItCoveredConditions()) return false; + if (hasDeprecatedItCoveredConditions()) { + if (getDeprecatedItCoveredConditions() + != other.getDeprecatedItCoveredConditions()) return false; + } + if (hasDeprecatedOverallLineHits() != other.hasDeprecatedOverallLineHits()) return false; + if (hasDeprecatedOverallLineHits()) { + if (getDeprecatedOverallLineHits() + != other.getDeprecatedOverallLineHits()) return false; + } + if (hasDeprecatedOverallConditions() != other.hasDeprecatedOverallConditions()) return false; + if (hasDeprecatedOverallConditions()) { + if (getDeprecatedOverallConditions() + != other.getDeprecatedOverallConditions()) return false; + } + if (hasDeprecatedOverallCoveredConditions() != other.hasDeprecatedOverallCoveredConditions()) return false; + if (hasDeprecatedOverallCoveredConditions()) { + if (getDeprecatedOverallCoveredConditions() + != other.getDeprecatedOverallCoveredConditions()) return false; + } + if (hasHighlighting() != other.hasHighlighting()) return false; + if (hasHighlighting()) { + if (!getHighlighting() + .equals(other.getHighlighting())) return false; + } + if (hasSymbols() != other.hasSymbols()) return false; + if (hasSymbols()) { + if (!getSymbols() + .equals(other.getSymbols())) return false; + } + if (!getDuplicationList() + .equals(other.getDuplicationList())) return false; + if (hasLineHits() != other.hasLineHits()) return false; + if (hasLineHits()) { + if (getLineHits() + != other.getLineHits()) return false; + } + if (hasConditions() != other.hasConditions()) return false; + if (hasConditions()) { + if (getConditions() + != other.getConditions()) return false; + } + if (hasCoveredConditions() != other.hasCoveredConditions()) return false; + if (hasCoveredConditions()) { + if (getCoveredConditions() + != other.getCoveredConditions()) return false; + } + if (hasIsNewLine() != other.hasIsNewLine()) return false; + if (hasIsNewLine()) { + if (getIsNewLine() + != other.getIsNewLine()) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasLine()) { + hash = (37 * hash) + LINE_FIELD_NUMBER; + hash = (53 * hash) + getLine(); + } + if (hasSource()) { + hash = (37 * hash) + SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getSource().hashCode(); + } + if (hasScmRevision()) { + hash = (37 * hash) + SCM_REVISION_FIELD_NUMBER; + hash = (53 * hash) + getScmRevision().hashCode(); + } + if (hasScmAuthor()) { + hash = (37 * hash) + SCM_AUTHOR_FIELD_NUMBER; + hash = (53 * hash) + getScmAuthor().hashCode(); + } + if (hasScmDate()) { + hash = (37 * hash) + SCM_DATE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getScmDate()); + } + if (hasDeprecatedUtLineHits()) { + hash = (37 * hash) + DEPRECATED_UT_LINE_HITS_FIELD_NUMBER; + hash = (53 * hash) + getDeprecatedUtLineHits(); + } + if (hasDeprecatedUtConditions()) { + hash = (37 * hash) + DEPRECATED_UT_CONDITIONS_FIELD_NUMBER; + hash = (53 * hash) + getDeprecatedUtConditions(); + } + if (hasDeprecatedUtCoveredConditions()) { + hash = (37 * hash) + DEPRECATED_UT_COVERED_CONDITIONS_FIELD_NUMBER; + hash = (53 * hash) + getDeprecatedUtCoveredConditions(); + } + if (hasDeprecatedItLineHits()) { + hash = (37 * hash) + DEPRECATED_IT_LINE_HITS_FIELD_NUMBER; + hash = (53 * hash) + getDeprecatedItLineHits(); + } + if (hasDeprecatedItConditions()) { + hash = (37 * hash) + DEPRECATED_IT_CONDITIONS_FIELD_NUMBER; + hash = (53 * hash) + getDeprecatedItConditions(); + } + if (hasDeprecatedItCoveredConditions()) { + hash = (37 * hash) + DEPRECATED_IT_COVERED_CONDITIONS_FIELD_NUMBER; + hash = (53 * hash) + getDeprecatedItCoveredConditions(); + } + if (hasDeprecatedOverallLineHits()) { + hash = (37 * hash) + DEPRECATED_OVERALL_LINE_HITS_FIELD_NUMBER; + hash = (53 * hash) + getDeprecatedOverallLineHits(); + } + if (hasDeprecatedOverallConditions()) { + hash = (37 * hash) + DEPRECATED_OVERALL_CONDITIONS_FIELD_NUMBER; + hash = (53 * hash) + getDeprecatedOverallConditions(); + } + if (hasDeprecatedOverallCoveredConditions()) { + hash = (37 * hash) + DEPRECATED_OVERALL_COVERED_CONDITIONS_FIELD_NUMBER; + hash = (53 * hash) + getDeprecatedOverallCoveredConditions(); + } + if (hasHighlighting()) { + hash = (37 * hash) + HIGHLIGHTING_FIELD_NUMBER; + hash = (53 * hash) + getHighlighting().hashCode(); + } + if (hasSymbols()) { + hash = (37 * hash) + SYMBOLS_FIELD_NUMBER; + hash = (53 * hash) + getSymbols().hashCode(); + } + if (getDuplicationCount() > 0) { + hash = (37 * hash) + DUPLICATION_FIELD_NUMBER; + hash = (53 * hash) + getDuplicationList().hashCode(); + } + if (hasLineHits()) { + hash = (37 * hash) + LINE_HITS_FIELD_NUMBER; + hash = (53 * hash) + getLineHits(); + } + if (hasConditions()) { + hash = (37 * hash) + CONDITIONS_FIELD_NUMBER; + hash = (53 * hash) + getConditions(); + } + if (hasCoveredConditions()) { + hash = (37 * hash) + COVERED_CONDITIONS_FIELD_NUMBER; + hash = (53 * hash) + getCoveredConditions(); + } + if (hasIsNewLine()) { + hash = (37 * hash) + IS_NEW_LINE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsNewLine()); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static Line parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Line parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Line parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Line parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Line parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Line parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Line parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static Line parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static Line parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static Line parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static Line parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static Line parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Line prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType( + BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code org.sonar.server.source.db.Line} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:org.sonar.server.source.db.Line) + LineOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return net.educoder.ecsonar.protobuf.DbFileSources.internal_static_org_sonar_server_source_db_Line_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return net.educoder.ecsonar.protobuf.DbFileSources.internal_static_org_sonar_server_source_db_Line_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Line.class, Builder.class); + } + + // Construct using net.educoder.ecsonar.protobuf.DbFileSources.Line.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @Override + public Builder clear() { + super.clear(); + line_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + source_ = ""; + bitField0_ = (bitField0_ & ~0x00000002); + scmRevision_ = ""; + bitField0_ = (bitField0_ & ~0x00000004); + scmAuthor_ = ""; + bitField0_ = (bitField0_ & ~0x00000008); + scmDate_ = 0L; + bitField0_ = (bitField0_ & ~0x00000010); + deprecatedUtLineHits_ = 0; + bitField0_ = (bitField0_ & ~0x00000020); + deprecatedUtConditions_ = 0; + bitField0_ = (bitField0_ & ~0x00000040); + deprecatedUtCoveredConditions_ = 0; + bitField0_ = (bitField0_ & ~0x00000080); + deprecatedItLineHits_ = 0; + bitField0_ = (bitField0_ & ~0x00000100); + deprecatedItConditions_ = 0; + bitField0_ = (bitField0_ & ~0x00000200); + deprecatedItCoveredConditions_ = 0; + bitField0_ = (bitField0_ & ~0x00000400); + deprecatedOverallLineHits_ = 0; + bitField0_ = (bitField0_ & ~0x00000800); + deprecatedOverallConditions_ = 0; + bitField0_ = (bitField0_ & ~0x00001000); + deprecatedOverallCoveredConditions_ = 0; + bitField0_ = (bitField0_ & ~0x00002000); + highlighting_ = ""; + bitField0_ = (bitField0_ & ~0x00004000); + symbols_ = ""; + bitField0_ = (bitField0_ & ~0x00008000); + duplication_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00010000); + lineHits_ = 0; + bitField0_ = (bitField0_ & ~0x00020000); + conditions_ = 0; + bitField0_ = (bitField0_ & ~0x00040000); + coveredConditions_ = 0; + bitField0_ = (bitField0_ & ~0x00080000); + isNewLine_ = false; + bitField0_ = (bitField0_ & ~0x00100000); + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return net.educoder.ecsonar.protobuf.DbFileSources.internal_static_org_sonar_server_source_db_Line_descriptor; + } + + @Override + public Line getDefaultInstanceForType() { + return Line.getDefaultInstance(); + } + + @Override + public Line build() { + Line result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public Line buildPartial() { + Line result = new Line(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.line_ = line_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + to_bitField0_ |= 0x00000002; + } + result.source_ = source_; + if (((from_bitField0_ & 0x00000004) != 0)) { + to_bitField0_ |= 0x00000004; + } + result.scmRevision_ = scmRevision_; + if (((from_bitField0_ & 0x00000008) != 0)) { + to_bitField0_ |= 0x00000008; + } + result.scmAuthor_ = scmAuthor_; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.scmDate_ = scmDate_; + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.deprecatedUtLineHits_ = deprecatedUtLineHits_; + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.deprecatedUtConditions_ = deprecatedUtConditions_; + to_bitField0_ |= 0x00000040; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.deprecatedUtCoveredConditions_ = deprecatedUtCoveredConditions_; + to_bitField0_ |= 0x00000080; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.deprecatedItLineHits_ = deprecatedItLineHits_; + to_bitField0_ |= 0x00000100; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.deprecatedItConditions_ = deprecatedItConditions_; + to_bitField0_ |= 0x00000200; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.deprecatedItCoveredConditions_ = deprecatedItCoveredConditions_; + to_bitField0_ |= 0x00000400; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.deprecatedOverallLineHits_ = deprecatedOverallLineHits_; + to_bitField0_ |= 0x00000800; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.deprecatedOverallConditions_ = deprecatedOverallConditions_; + to_bitField0_ |= 0x00001000; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.deprecatedOverallCoveredConditions_ = deprecatedOverallCoveredConditions_; + to_bitField0_ |= 0x00002000; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + to_bitField0_ |= 0x00004000; + } + result.highlighting_ = highlighting_; + if (((from_bitField0_ & 0x00008000) != 0)) { + to_bitField0_ |= 0x00008000; + } + result.symbols_ = symbols_; + if (((bitField0_ & 0x00010000) != 0)) { + duplication_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00010000); + } + result.duplication_ = duplication_; + if (((from_bitField0_ & 0x00020000) != 0)) { + result.lineHits_ = lineHits_; + to_bitField0_ |= 0x00010000; + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.conditions_ = conditions_; + to_bitField0_ |= 0x00020000; + } + if (((from_bitField0_ & 0x00080000) != 0)) { + result.coveredConditions_ = coveredConditions_; + to_bitField0_ |= 0x00040000; + } + if (((from_bitField0_ & 0x00100000) != 0)) { + result.isNewLine_ = isNewLine_; + to_bitField0_ |= 0x00080000; + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @Override + public Builder clone() { + return super.clone(); + } + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.setField(field, value); + } + @Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return super.setRepeatedField(field, index, value); + } + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.addRepeatedField(field, value); + } + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof Line) { + return mergeFrom((Line)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(Line other) { + if (other == Line.getDefaultInstance()) return this; + if (other.hasLine()) { + setLine(other.getLine()); + } + if (other.hasSource()) { + bitField0_ |= 0x00000002; + source_ = other.source_; + onChanged(); + } + if (other.hasScmRevision()) { + bitField0_ |= 0x00000004; + scmRevision_ = other.scmRevision_; + onChanged(); + } + if (other.hasScmAuthor()) { + bitField0_ |= 0x00000008; + scmAuthor_ = other.scmAuthor_; + onChanged(); + } + if (other.hasScmDate()) { + setScmDate(other.getScmDate()); + } + if (other.hasDeprecatedUtLineHits()) { + setDeprecatedUtLineHits(other.getDeprecatedUtLineHits()); + } + if (other.hasDeprecatedUtConditions()) { + setDeprecatedUtConditions(other.getDeprecatedUtConditions()); + } + if (other.hasDeprecatedUtCoveredConditions()) { + setDeprecatedUtCoveredConditions(other.getDeprecatedUtCoveredConditions()); + } + if (other.hasDeprecatedItLineHits()) { + setDeprecatedItLineHits(other.getDeprecatedItLineHits()); + } + if (other.hasDeprecatedItConditions()) { + setDeprecatedItConditions(other.getDeprecatedItConditions()); + } + if (other.hasDeprecatedItCoveredConditions()) { + setDeprecatedItCoveredConditions(other.getDeprecatedItCoveredConditions()); + } + if (other.hasDeprecatedOverallLineHits()) { + setDeprecatedOverallLineHits(other.getDeprecatedOverallLineHits()); + } + if (other.hasDeprecatedOverallConditions()) { + setDeprecatedOverallConditions(other.getDeprecatedOverallConditions()); + } + if (other.hasDeprecatedOverallCoveredConditions()) { + setDeprecatedOverallCoveredConditions(other.getDeprecatedOverallCoveredConditions()); + } + if (other.hasHighlighting()) { + bitField0_ |= 0x00004000; + highlighting_ = other.highlighting_; + onChanged(); + } + if (other.hasSymbols()) { + bitField0_ |= 0x00008000; + symbols_ = other.symbols_; + onChanged(); + } + if (!other.duplication_.isEmpty()) { + if (duplication_.isEmpty()) { + duplication_ = other.duplication_; + bitField0_ = (bitField0_ & ~0x00010000); + } else { + ensureDuplicationIsMutable(); + duplication_.addAll(other.duplication_); + } + onChanged(); + } + if (other.hasLineHits()) { + setLineHits(other.getLineHits()); + } + if (other.hasConditions()) { + setConditions(other.getConditions()); + } + if (other.hasCoveredConditions()) { + setCoveredConditions(other.getCoveredConditions()); + } + if (other.hasIsNewLine()) { + setIsNewLine(other.getIsNewLine()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + Line parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (Line) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int line_ ; + /** + * optional int32 line = 1; + * @return Whether the line field is set. + */ + @Override + public boolean hasLine() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 line = 1; + * @return The line. + */ + @Override + public int getLine() { + return line_; + } + /** + * optional int32 line = 1; + * @param value The line to set. + * @return This builder for chaining. + */ + public Builder setLine(int value) { + bitField0_ |= 0x00000001; + line_ = value; + onChanged(); + return this; + } + /** + * optional int32 line = 1; + * @return This builder for chaining. + */ + public Builder clearLine() { + bitField0_ = (bitField0_ & ~0x00000001); + line_ = 0; + onChanged(); + return this; + } + + private Object source_ = ""; + /** + * optional string source = 2; + * @return Whether the source field is set. + */ + @Override + public boolean hasSource() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional string source = 2; + * @return The source. + */ + @Override + public String getSource() { + Object ref = source_; + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + source_ = s; + } + return s; + } else { + return (String) ref; + } + } + /** + * optional string source = 2; + * @return The bytes for source. + */ + @Override + public com.google.protobuf.ByteString + getSourceBytes() { + Object ref = source_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + source_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string source = 2; + * @param value The source to set. + * @return This builder for chaining. + */ + public Builder setSource( + String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + source_ = value; + onChanged(); + return this; + } + /** + * optional string source = 2; + * @return This builder for chaining. + */ + public Builder clearSource() { + bitField0_ = (bitField0_ & ~0x00000002); + source_ = getDefaultInstance().getSource(); + onChanged(); + return this; + } + /** + * optional string source = 2; + * @param value The bytes for source to set. + * @return This builder for chaining. + */ + public Builder setSourceBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + source_ = value; + onChanged(); + return this; + } + + private Object scmRevision_ = ""; + /** + *
+       * SCM
+       * 
+ * + * optional string scm_revision = 3; + * @return Whether the scmRevision field is set. + */ + public boolean hasScmRevision() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + *
+       * SCM
+       * 
+ * + * optional string scm_revision = 3; + * @return The scmRevision. + */ + @Override + public String getScmRevision() { + Object ref = scmRevision_; + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + scmRevision_ = s; + } + return s; + } else { + return (String) ref; + } + } + /** + *
+       * SCM
+       * 
+ * + * optional string scm_revision = 3; + * @return The bytes for scmRevision. + */ + @Override + public com.google.protobuf.ByteString + getScmRevisionBytes() { + Object ref = scmRevision_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + scmRevision_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * SCM
+       * 
+ * + * optional string scm_revision = 3; + * @param value The scmRevision to set. + * @return This builder for chaining. + */ + public Builder setScmRevision( + String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + scmRevision_ = value; + onChanged(); + return this; + } + /** + *
+       * SCM
+       * 
+ * + * optional string scm_revision = 3; + * @return This builder for chaining. + */ + public Builder clearScmRevision() { + bitField0_ = (bitField0_ & ~0x00000004); + scmRevision_ = getDefaultInstance().getScmRevision(); + onChanged(); + return this; + } + /** + *
+       * SCM
+       * 
+ * + * optional string scm_revision = 3; + * @param value The bytes for scmRevision to set. + * @return This builder for chaining. + */ + public Builder setScmRevisionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + scmRevision_ = value; + onChanged(); + return this; + } + + private Object scmAuthor_ = ""; + /** + * optional string scm_author = 4; + * @return Whether the scmAuthor field is set. + */ + @Override + public boolean hasScmAuthor() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * optional string scm_author = 4; + * @return The scmAuthor. + */ + @Override + public String getScmAuthor() { + Object ref = scmAuthor_; + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + scmAuthor_ = s; + } + return s; + } else { + return (String) ref; + } + } + /** + * optional string scm_author = 4; + * @return The bytes for scmAuthor. + */ + public com.google.protobuf.ByteString + getScmAuthorBytes() { + Object ref = scmAuthor_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + scmAuthor_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string scm_author = 4; + * @param value The scmAuthor to set. + * @return This builder for chaining. + */ + public Builder setScmAuthor( + String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + scmAuthor_ = value; + onChanged(); + return this; + } + /** + * optional string scm_author = 4; + * @return This builder for chaining. + */ + public Builder clearScmAuthor() { + bitField0_ = (bitField0_ & ~0x00000008); + scmAuthor_ = getDefaultInstance().getScmAuthor(); + onChanged(); + return this; + } + /** + * optional string scm_author = 4; + * @param value The bytes for scmAuthor to set. + * @return This builder for chaining. + */ + public Builder setScmAuthorBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000008; + scmAuthor_ = value; + onChanged(); + return this; + } + + private long scmDate_ ; + /** + * optional int64 scm_date = 5; + * @return Whether the scmDate field is set. + */ + @Override + public boolean hasScmDate() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * optional int64 scm_date = 5; + * @return The scmDate. + */ + @Override + public long getScmDate() { + return scmDate_; + } + /** + * optional int64 scm_date = 5; + * @param value The scmDate to set. + * @return This builder for chaining. + */ + public Builder setScmDate(long value) { + bitField0_ |= 0x00000010; + scmDate_ = value; + onChanged(); + return this; + } + /** + * optional int64 scm_date = 5; + * @return This builder for chaining. + */ + public Builder clearScmDate() { + bitField0_ = (bitField0_ & ~0x00000010); + scmDate_ = 0L; + onChanged(); + return this; + } + + private int deprecatedUtLineHits_ ; + /** + *
+       * Deprecated fields in 6.2 (has been deprecated when merging coverage into a single metric)
+       * They are still used to read coverage info from sources that have not be re-analyzed
+       * 
+ * + * optional int32 deprecated_ut_line_hits = 6; + * @return Whether the deprecatedUtLineHits field is set. + */ + @Override + public boolean hasDeprecatedUtLineHits() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + *
+       * Deprecated fields in 6.2 (has been deprecated when merging coverage into a single metric)
+       * They are still used to read coverage info from sources that have not be re-analyzed
+       * 
+ * + * optional int32 deprecated_ut_line_hits = 6; + * @return The deprecatedUtLineHits. + */ + @Override + public int getDeprecatedUtLineHits() { + return deprecatedUtLineHits_; + } + /** + *
+       * Deprecated fields in 6.2 (has been deprecated when merging coverage into a single metric)
+       * They are still used to read coverage info from sources that have not be re-analyzed
+       * 
+ * + * optional int32 deprecated_ut_line_hits = 6; + * @param value The deprecatedUtLineHits to set. + * @return This builder for chaining. + */ + public Builder setDeprecatedUtLineHits(int value) { + bitField0_ |= 0x00000020; + deprecatedUtLineHits_ = value; + onChanged(); + return this; + } + /** + *
+       * Deprecated fields in 6.2 (has been deprecated when merging coverage into a single metric)
+       * They are still used to read coverage info from sources that have not be re-analyzed
+       * 
+ * + * optional int32 deprecated_ut_line_hits = 6; + * @return This builder for chaining. + */ + public Builder clearDeprecatedUtLineHits() { + bitField0_ = (bitField0_ & ~0x00000020); + deprecatedUtLineHits_ = 0; + onChanged(); + return this; + } + + private int deprecatedUtConditions_ ; + /** + * optional int32 deprecated_ut_conditions = 7; + * @return Whether the deprecatedUtConditions field is set. + */ + @Override + public boolean hasDeprecatedUtConditions() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * optional int32 deprecated_ut_conditions = 7; + * @return The deprecatedUtConditions. + */ + @Override + public int getDeprecatedUtConditions() { + return deprecatedUtConditions_; + } + /** + * optional int32 deprecated_ut_conditions = 7; + * @param value The deprecatedUtConditions to set. + * @return This builder for chaining. + */ + public Builder setDeprecatedUtConditions(int value) { + bitField0_ |= 0x00000040; + deprecatedUtConditions_ = value; + onChanged(); + return this; + } + /** + * optional int32 deprecated_ut_conditions = 7; + * @return This builder for chaining. + */ + public Builder clearDeprecatedUtConditions() { + bitField0_ = (bitField0_ & ~0x00000040); + deprecatedUtConditions_ = 0; + onChanged(); + return this; + } + + private int deprecatedUtCoveredConditions_ ; + /** + * optional int32 deprecated_ut_covered_conditions = 8; + * @return Whether the deprecatedUtCoveredConditions field is set. + */ + @Override + public boolean hasDeprecatedUtCoveredConditions() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * optional int32 deprecated_ut_covered_conditions = 8; + * @return The deprecatedUtCoveredConditions. + */ + @Override + public int getDeprecatedUtCoveredConditions() { + return deprecatedUtCoveredConditions_; + } + /** + * optional int32 deprecated_ut_covered_conditions = 8; + * @param value The deprecatedUtCoveredConditions to set. + * @return This builder for chaining. + */ + public Builder setDeprecatedUtCoveredConditions(int value) { + bitField0_ |= 0x00000080; + deprecatedUtCoveredConditions_ = value; + onChanged(); + return this; + } + /** + * optional int32 deprecated_ut_covered_conditions = 8; + * @return This builder for chaining. + */ + public Builder clearDeprecatedUtCoveredConditions() { + bitField0_ = (bitField0_ & ~0x00000080); + deprecatedUtCoveredConditions_ = 0; + onChanged(); + return this; + } + + private int deprecatedItLineHits_ ; + /** + * optional int32 deprecated_it_line_hits = 9; + * @return Whether the deprecatedItLineHits field is set. + */ + @Override + public boolean hasDeprecatedItLineHits() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * optional int32 deprecated_it_line_hits = 9; + * @return The deprecatedItLineHits. + */ + @Override + public int getDeprecatedItLineHits() { + return deprecatedItLineHits_; + } + /** + * optional int32 deprecated_it_line_hits = 9; + * @param value The deprecatedItLineHits to set. + * @return This builder for chaining. + */ + public Builder setDeprecatedItLineHits(int value) { + bitField0_ |= 0x00000100; + deprecatedItLineHits_ = value; + onChanged(); + return this; + } + /** + * optional int32 deprecated_it_line_hits = 9; + * @return This builder for chaining. + */ + public Builder clearDeprecatedItLineHits() { + bitField0_ = (bitField0_ & ~0x00000100); + deprecatedItLineHits_ = 0; + onChanged(); + return this; + } + + private int deprecatedItConditions_ ; + /** + * optional int32 deprecated_it_conditions = 10; + * @return Whether the deprecatedItConditions field is set. + */ + @Override + public boolean hasDeprecatedItConditions() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + * optional int32 deprecated_it_conditions = 10; + * @return The deprecatedItConditions. + */ + @Override + public int getDeprecatedItConditions() { + return deprecatedItConditions_; + } + /** + * optional int32 deprecated_it_conditions = 10; + * @param value The deprecatedItConditions to set. + * @return This builder for chaining. + */ + public Builder setDeprecatedItConditions(int value) { + bitField0_ |= 0x00000200; + deprecatedItConditions_ = value; + onChanged(); + return this; + } + /** + * optional int32 deprecated_it_conditions = 10; + * @return This builder for chaining. + */ + public Builder clearDeprecatedItConditions() { + bitField0_ = (bitField0_ & ~0x00000200); + deprecatedItConditions_ = 0; + onChanged(); + return this; + } + + private int deprecatedItCoveredConditions_ ; + /** + * optional int32 deprecated_it_covered_conditions = 11; + * @return Whether the deprecatedItCoveredConditions field is set. + */ + @Override + public boolean hasDeprecatedItCoveredConditions() { + return ((bitField0_ & 0x00000400) != 0); + } + /** + * optional int32 deprecated_it_covered_conditions = 11; + * @return The deprecatedItCoveredConditions. + */ + @Override + public int getDeprecatedItCoveredConditions() { + return deprecatedItCoveredConditions_; + } + /** + * optional int32 deprecated_it_covered_conditions = 11; + * @param value The deprecatedItCoveredConditions to set. + * @return This builder for chaining. + */ + public Builder setDeprecatedItCoveredConditions(int value) { + bitField0_ |= 0x00000400; + deprecatedItCoveredConditions_ = value; + onChanged(); + return this; + } + /** + * optional int32 deprecated_it_covered_conditions = 11; + * @return This builder for chaining. + */ + public Builder clearDeprecatedItCoveredConditions() { + bitField0_ = (bitField0_ & ~0x00000400); + deprecatedItCoveredConditions_ = 0; + onChanged(); + return this; + } + + private int deprecatedOverallLineHits_ ; + /** + * optional int32 deprecated_overall_line_hits = 12; + * @return Whether the deprecatedOverallLineHits field is set. + */ + @Override + public boolean hasDeprecatedOverallLineHits() { + return ((bitField0_ & 0x00000800) != 0); + } + /** + * optional int32 deprecated_overall_line_hits = 12; + * @return The deprecatedOverallLineHits. + */ + @Override + public int getDeprecatedOverallLineHits() { + return deprecatedOverallLineHits_; + } + /** + * optional int32 deprecated_overall_line_hits = 12; + * @param value The deprecatedOverallLineHits to set. + * @return This builder for chaining. + */ + public Builder setDeprecatedOverallLineHits(int value) { + bitField0_ |= 0x00000800; + deprecatedOverallLineHits_ = value; + onChanged(); + return this; + } + /** + * optional int32 deprecated_overall_line_hits = 12; + * @return This builder for chaining. + */ + public Builder clearDeprecatedOverallLineHits() { + bitField0_ = (bitField0_ & ~0x00000800); + deprecatedOverallLineHits_ = 0; + onChanged(); + return this; + } + + private int deprecatedOverallConditions_ ; + /** + * optional int32 deprecated_overall_conditions = 13; + * @return Whether the deprecatedOverallConditions field is set. + */ + @Override + public boolean hasDeprecatedOverallConditions() { + return ((bitField0_ & 0x00001000) != 0); + } + /** + * optional int32 deprecated_overall_conditions = 13; + * @return The deprecatedOverallConditions. + */ + @Override + public int getDeprecatedOverallConditions() { + return deprecatedOverallConditions_; + } + /** + * optional int32 deprecated_overall_conditions = 13; + * @param value The deprecatedOverallConditions to set. + * @return This builder for chaining. + */ + public Builder setDeprecatedOverallConditions(int value) { + bitField0_ |= 0x00001000; + deprecatedOverallConditions_ = value; + onChanged(); + return this; + } + /** + * optional int32 deprecated_overall_conditions = 13; + * @return This builder for chaining. + */ + public Builder clearDeprecatedOverallConditions() { + bitField0_ = (bitField0_ & ~0x00001000); + deprecatedOverallConditions_ = 0; + onChanged(); + return this; + } + + private int deprecatedOverallCoveredConditions_ ; + /** + * optional int32 deprecated_overall_covered_conditions = 14; + * @return Whether the deprecatedOverallCoveredConditions field is set. + */ + @Override + public boolean hasDeprecatedOverallCoveredConditions() { + return ((bitField0_ & 0x00002000) != 0); + } + /** + * optional int32 deprecated_overall_covered_conditions = 14; + * @return The deprecatedOverallCoveredConditions. + */ + @Override + public int getDeprecatedOverallCoveredConditions() { + return deprecatedOverallCoveredConditions_; + } + /** + * optional int32 deprecated_overall_covered_conditions = 14; + * @param value The deprecatedOverallCoveredConditions to set. + * @return This builder for chaining. + */ + public Builder setDeprecatedOverallCoveredConditions(int value) { + bitField0_ |= 0x00002000; + deprecatedOverallCoveredConditions_ = value; + onChanged(); + return this; + } + /** + * optional int32 deprecated_overall_covered_conditions = 14; + * @return This builder for chaining. + */ + public Builder clearDeprecatedOverallCoveredConditions() { + bitField0_ = (bitField0_ & ~0x00002000); + deprecatedOverallCoveredConditions_ = 0; + onChanged(); + return this; + } + + private Object highlighting_ = ""; + /** + * optional string highlighting = 15; + * @return Whether the highlighting field is set. + */ + public boolean hasHighlighting() { + return ((bitField0_ & 0x00004000) != 0); + } + /** + * optional string highlighting = 15; + * @return The highlighting. + */ + public String getHighlighting() { + Object ref = highlighting_; + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + highlighting_ = s; + } + return s; + } else { + return (String) ref; + } + } + /** + * optional string highlighting = 15; + * @return The bytes for highlighting. + */ + public com.google.protobuf.ByteString + getHighlightingBytes() { + Object ref = highlighting_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + highlighting_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string highlighting = 15; + * @param value The highlighting to set. + * @return This builder for chaining. + */ + public Builder setHighlighting( + String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00004000; + highlighting_ = value; + onChanged(); + return this; + } + /** + * optional string highlighting = 15; + * @return This builder for chaining. + */ + public Builder clearHighlighting() { + bitField0_ = (bitField0_ & ~0x00004000); + highlighting_ = getDefaultInstance().getHighlighting(); + onChanged(); + return this; + } + /** + * optional string highlighting = 15; + * @param value The bytes for highlighting to set. + * @return This builder for chaining. + */ + public Builder setHighlightingBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00004000; + highlighting_ = value; + onChanged(); + return this; + } + + private Object symbols_ = ""; + /** + * optional string symbols = 16; + * @return Whether the symbols field is set. + */ + public boolean hasSymbols() { + return ((bitField0_ & 0x00008000) != 0); + } + /** + * optional string symbols = 16; + * @return The symbols. + */ + public String getSymbols() { + Object ref = symbols_; + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + symbols_ = s; + } + return s; + } else { + return (String) ref; + } + } + /** + * optional string symbols = 16; + * @return The bytes for symbols. + */ + public com.google.protobuf.ByteString + getSymbolsBytes() { + Object ref = symbols_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + symbols_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string symbols = 16; + * @param value The symbols to set. + * @return This builder for chaining. + */ + public Builder setSymbols( + String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00008000; + symbols_ = value; + onChanged(); + return this; + } + /** + * optional string symbols = 16; + * @return This builder for chaining. + */ + public Builder clearSymbols() { + bitField0_ = (bitField0_ & ~0x00008000); + symbols_ = getDefaultInstance().getSymbols(); + onChanged(); + return this; + } + /** + * optional string symbols = 16; + * @param value The bytes for symbols to set. + * @return This builder for chaining. + */ + public Builder setSymbolsBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00008000; + symbols_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.IntList duplication_ = emptyIntList(); + private void ensureDuplicationIsMutable() { + if (!((bitField0_ & 0x00010000) != 0)) { + duplication_ = mutableCopy(duplication_); + bitField0_ |= 0x00010000; + } + } + /** + * repeated int32 duplication = 17 [packed = true]; + * @return A list containing the duplication. + */ + public java.util.List + getDuplicationList() { + return ((bitField0_ & 0x00010000) != 0) ? + java.util.Collections.unmodifiableList(duplication_) : duplication_; + } + /** + * repeated int32 duplication = 17 [packed = true]; + * @return The count of duplication. + */ + public int getDuplicationCount() { + return duplication_.size(); + } + /** + * repeated int32 duplication = 17 [packed = true]; + * @param index The index of the element to return. + * @return The duplication at the given index. + */ + public int getDuplication(int index) { + return duplication_.getInt(index); + } + /** + * repeated int32 duplication = 17 [packed = true]; + * @param index The index to set the value at. + * @param value The duplication to set. + * @return This builder for chaining. + */ + public Builder setDuplication( + int index, int value) { + ensureDuplicationIsMutable(); + duplication_.setInt(index, value); + onChanged(); + return this; + } + /** + * repeated int32 duplication = 17 [packed = true]; + * @param value The duplication to add. + * @return This builder for chaining. + */ + public Builder addDuplication(int value) { + ensureDuplicationIsMutable(); + duplication_.addInt(value); + onChanged(); + return this; + } + /** + * repeated int32 duplication = 17 [packed = true]; + * @param values The duplication to add. + * @return This builder for chaining. + */ + public Builder addAllDuplication( + Iterable values) { + ensureDuplicationIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, duplication_); + onChanged(); + return this; + } + /** + * repeated int32 duplication = 17 [packed = true]; + * @return This builder for chaining. + */ + public Builder clearDuplication() { + duplication_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00010000); + onChanged(); + return this; + } + + private int lineHits_ ; + /** + *
+       * coverage info (since 6.2)
+       * 
+ * + * optional int32 line_hits = 18; + * @return Whether the lineHits field is set. + */ + @Override + public boolean hasLineHits() { + return ((bitField0_ & 0x00020000) != 0); + } + /** + *
+       * coverage info (since 6.2)
+       * 
+ * + * optional int32 line_hits = 18; + * @return The lineHits. + */ + @Override + public int getLineHits() { + return lineHits_; + } + /** + *
+       * coverage info (since 6.2)
+       * 
+ * + * optional int32 line_hits = 18; + * @param value The lineHits to set. + * @return This builder for chaining. + */ + public Builder setLineHits(int value) { + bitField0_ |= 0x00020000; + lineHits_ = value; + onChanged(); + return this; + } + /** + *
+       * coverage info (since 6.2)
+       * 
+ * + * optional int32 line_hits = 18; + * @return This builder for chaining. + */ + public Builder clearLineHits() { + bitField0_ = (bitField0_ & ~0x00020000); + lineHits_ = 0; + onChanged(); + return this; + } + + private int conditions_ ; + /** + * optional int32 conditions = 19; + * @return Whether the conditions field is set. + */ + @Override + public boolean hasConditions() { + return ((bitField0_ & 0x00040000) != 0); + } + /** + * optional int32 conditions = 19; + * @return The conditions. + */ + @Override + public int getConditions() { + return conditions_; + } + /** + * optional int32 conditions = 19; + * @param value The conditions to set. + * @return This builder for chaining. + */ + public Builder setConditions(int value) { + bitField0_ |= 0x00040000; + conditions_ = value; + onChanged(); + return this; + } + /** + * optional int32 conditions = 19; + * @return This builder for chaining. + */ + public Builder clearConditions() { + bitField0_ = (bitField0_ & ~0x00040000); + conditions_ = 0; + onChanged(); + return this; + } + + private int coveredConditions_ ; + /** + * optional int32 covered_conditions = 20; + * @return Whether the coveredConditions field is set. + */ + @Override + public boolean hasCoveredConditions() { + return ((bitField0_ & 0x00080000) != 0); + } + /** + * optional int32 covered_conditions = 20; + * @return The coveredConditions. + */ + @Override + public int getCoveredConditions() { + return coveredConditions_; + } + /** + * optional int32 covered_conditions = 20; + * @param value The coveredConditions to set. + * @return This builder for chaining. + */ + public Builder setCoveredConditions(int value) { + bitField0_ |= 0x00080000; + coveredConditions_ = value; + onChanged(); + return this; + } + /** + * optional int32 covered_conditions = 20; + * @return This builder for chaining. + */ + public Builder clearCoveredConditions() { + bitField0_ = (bitField0_ & ~0x00080000); + coveredConditions_ = 0; + onChanged(); + return this; + } + + private boolean isNewLine_ ; + /** + * optional bool is_new_line = 21; + * @return Whether the isNewLine field is set. + */ + @Override + public boolean hasIsNewLine() { + return ((bitField0_ & 0x00100000) != 0); + } + /** + * optional bool is_new_line = 21; + * @return The isNewLine. + */ + @Override + public boolean getIsNewLine() { + return isNewLine_; + } + /** + * optional bool is_new_line = 21; + * @param value The isNewLine to set. + * @return This builder for chaining. + */ + public Builder setIsNewLine(boolean value) { + bitField0_ |= 0x00100000; + isNewLine_ = value; + onChanged(); + return this; + } + /** + * optional bool is_new_line = 21; + * @return This builder for chaining. + */ + public Builder clearIsNewLine() { + bitField0_ = (bitField0_ & ~0x00100000); + isNewLine_ = false; + onChanged(); + return this; + } + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:org.sonar.server.source.db.Line) + } + + // @@protoc_insertion_point(class_scope:org.sonar.server.source.db.Line) + private static final Line DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Line(); + } + + public static Line getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @Deprecated + public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @Override + public Line parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Line(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public Line getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface RangeOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.sonar.server.source.db.Range) + com.google.protobuf.MessageOrBuilder { + + /** + * optional int32 startOffset = 1; + * @return Whether the startOffset field is set. + */ + boolean hasStartOffset(); + /** + * optional int32 startOffset = 1; + * @return The startOffset. + */ + int getStartOffset(); + + /** + * optional int32 endOffset = 2; + * @return Whether the endOffset field is set. + */ + boolean hasEndOffset(); + /** + * optional int32 endOffset = 2; + * @return The endOffset. + */ + int getEndOffset(); + } + /** + * Protobuf type {@code org.sonar.server.source.db.Range} + */ + public static final class Range extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:org.sonar.server.source.db.Range) + RangeOrBuilder { + private static final long serialVersionUID = 0L; + // Use Range.newBuilder() to construct. + private Range(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Range() { + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance( + UnusedPrivateParameter unused) { + return new Range(); + } + + @Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Range( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + bitField0_ |= 0x00000001; + startOffset_ = input.readInt32(); + break; + } + case 16: { + bitField0_ |= 0x00000002; + endOffset_ = input.readInt32(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return net.educoder.ecsonar.protobuf.DbFileSources.internal_static_org_sonar_server_source_db_Range_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return net.educoder.ecsonar.protobuf.DbFileSources.internal_static_org_sonar_server_source_db_Range_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Range.class, Builder.class); + } + + private int bitField0_; + public static final int STARTOFFSET_FIELD_NUMBER = 1; + private int startOffset_; + /** + * optional int32 startOffset = 1; + * @return Whether the startOffset field is set. + */ + @Override + public boolean hasStartOffset() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 startOffset = 1; + * @return The startOffset. + */ + @Override + public int getStartOffset() { + return startOffset_; + } + + public static final int ENDOFFSET_FIELD_NUMBER = 2; + private int endOffset_; + /** + * optional int32 endOffset = 2; + * @return Whether the endOffset field is set. + */ + @Override + public boolean hasEndOffset() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional int32 endOffset = 2; + * @return The endOffset. + */ + @Override + public int getEndOffset() { + return endOffset_; + } + + private byte memoizedIsInitialized = -1; + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(1, startOffset_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt32(2, endOffset_); + } + unknownFields.writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, startOffset_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, endOffset_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Range)) { + return super.equals(obj); + } + Range other = (Range) obj; + + if (hasStartOffset() != other.hasStartOffset()) return false; + if (hasStartOffset()) { + if (getStartOffset() + != other.getStartOffset()) return false; + } + if (hasEndOffset() != other.hasEndOffset()) return false; + if (hasEndOffset()) { + if (getEndOffset() + != other.getEndOffset()) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasStartOffset()) { + hash = (37 * hash) + STARTOFFSET_FIELD_NUMBER; + hash = (53 * hash) + getStartOffset(); + } + if (hasEndOffset()) { + hash = (37 * hash) + ENDOFFSET_FIELD_NUMBER; + hash = (53 * hash) + getEndOffset(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static Range parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Range parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Range parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Range parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Range parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Range parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Range parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static Range parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static Range parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static Range parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static Range parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static Range parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Range prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType( + BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code org.sonar.server.source.db.Range} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:org.sonar.server.source.db.Range) + RangeOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return net.educoder.ecsonar.protobuf.DbFileSources.internal_static_org_sonar_server_source_db_Range_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return net.educoder.ecsonar.protobuf.DbFileSources.internal_static_org_sonar_server_source_db_Range_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Range.class, Builder.class); + } + + // Construct using net.educoder.ecsonar.protobuf.DbFileSources.Range.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @Override + public Builder clear() { + super.clear(); + startOffset_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + endOffset_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return net.educoder.ecsonar.protobuf.DbFileSources.internal_static_org_sonar_server_source_db_Range_descriptor; + } + + @Override + public Range getDefaultInstanceForType() { + return Range.getDefaultInstance(); + } + + @Override + public Range build() { + Range result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public Range buildPartial() { + Range result = new Range(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.startOffset_ = startOffset_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.endOffset_ = endOffset_; + to_bitField0_ |= 0x00000002; + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @Override + public Builder clone() { + return super.clone(); + } + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.setField(field, value); + } + @Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return super.setRepeatedField(field, index, value); + } + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.addRepeatedField(field, value); + } + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof Range) { + return mergeFrom((Range)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(Range other) { + if (other == Range.getDefaultInstance()) return this; + if (other.hasStartOffset()) { + setStartOffset(other.getStartOffset()); + } + if (other.hasEndOffset()) { + setEndOffset(other.getEndOffset()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + Range parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (Range) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private int startOffset_ ; + /** + * optional int32 startOffset = 1; + * @return Whether the startOffset field is set. + */ + @Override + public boolean hasStartOffset() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 startOffset = 1; + * @return The startOffset. + */ + @Override + public int getStartOffset() { + return startOffset_; + } + /** + * optional int32 startOffset = 1; + * @param value The startOffset to set. + * @return This builder for chaining. + */ + public Builder setStartOffset(int value) { + bitField0_ |= 0x00000001; + startOffset_ = value; + onChanged(); + return this; + } + /** + * optional int32 startOffset = 1; + * @return This builder for chaining. + */ + public Builder clearStartOffset() { + bitField0_ = (bitField0_ & ~0x00000001); + startOffset_ = 0; + onChanged(); + return this; + } + + private int endOffset_ ; + /** + * optional int32 endOffset = 2; + * @return Whether the endOffset field is set. + */ + @Override + public boolean hasEndOffset() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional int32 endOffset = 2; + * @return The endOffset. + */ + @Override + public int getEndOffset() { + return endOffset_; + } + /** + * optional int32 endOffset = 2; + * @param value The endOffset to set. + * @return This builder for chaining. + */ + public Builder setEndOffset(int value) { + bitField0_ |= 0x00000002; + endOffset_ = value; + onChanged(); + return this; + } + /** + * optional int32 endOffset = 2; + * @return This builder for chaining. + */ + public Builder clearEndOffset() { + bitField0_ = (bitField0_ & ~0x00000002); + endOffset_ = 0; + onChanged(); + return this; + } + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:org.sonar.server.source.db.Range) + } + + // @@protoc_insertion_point(class_scope:org.sonar.server.source.db.Range) + private static final Range DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Range(); + } + + public static Range getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @Deprecated + public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @Override + public Range parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Range(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public Range getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DataOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.sonar.server.source.db.Data) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .org.sonar.server.source.db.Line lines = 1; + */ + java.util.List + getLinesList(); + /** + * repeated .org.sonar.server.source.db.Line lines = 1; + */ + Line getLines(int index); + /** + * repeated .org.sonar.server.source.db.Line lines = 1; + */ + int getLinesCount(); + /** + * repeated .org.sonar.server.source.db.Line lines = 1; + */ + java.util.List + getLinesOrBuilderList(); + /** + * repeated .org.sonar.server.source.db.Line lines = 1; + */ + LineOrBuilder getLinesOrBuilder( + int index); + } + /** + *
+   * TODO should be dropped as it prevents streaming
+   * 
+ * + * Protobuf type {@code org.sonar.server.source.db.Data} + */ + public static final class Data extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:org.sonar.server.source.db.Data) + DataOrBuilder { + private static final long serialVersionUID = 0L; + // Use Data.newBuilder() to construct. + private Data(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Data() { + lines_ = java.util.Collections.emptyList(); + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance( + UnusedPrivateParameter unused) { + return new Data(); + } + + @Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Data( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + lines_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + lines_.add( + input.readMessage(Line.PARSER, extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + lines_ = java.util.Collections.unmodifiableList(lines_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return net.educoder.ecsonar.protobuf.DbFileSources.internal_static_org_sonar_server_source_db_Data_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return net.educoder.ecsonar.protobuf.DbFileSources.internal_static_org_sonar_server_source_db_Data_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Data.class, Builder.class); + } + + public static final int LINES_FIELD_NUMBER = 1; + private java.util.List lines_; + /** + * repeated .org.sonar.server.source.db.Line lines = 1; + */ + @Override + public java.util.List getLinesList() { + return lines_; + } + /** + * repeated .org.sonar.server.source.db.Line lines = 1; + */ + @Override + public java.util.List + getLinesOrBuilderList() { + return lines_; + } + /** + * repeated .org.sonar.server.source.db.Line lines = 1; + */ + @Override + public int getLinesCount() { + return lines_.size(); + } + /** + * repeated .org.sonar.server.source.db.Line lines = 1; + */ + @Override + public Line getLines(int index) { + return lines_.get(index); + } + /** + * repeated .org.sonar.server.source.db.Line lines = 1; + */ + @Override + public LineOrBuilder getLinesOrBuilder( + int index) { + return lines_.get(index); + } + + private byte memoizedIsInitialized = -1; + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < lines_.size(); i++) { + output.writeMessage(1, lines_.get(i)); + } + unknownFields.writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < lines_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, lines_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Data)) { + return super.equals(obj); + } + Data other = (Data) obj; + + if (!getLinesList() + .equals(other.getLinesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getLinesCount() > 0) { + hash = (37 * hash) + LINES_FIELD_NUMBER; + hash = (53 * hash) + getLinesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static Data parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Data parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Data parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Data parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Data parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Data parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Data parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static Data parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static Data parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static Data parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static Data parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static Data parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Data prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType( + BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+     * TODO should be dropped as it prevents streaming
+     * 
+ * + * Protobuf type {@code org.sonar.server.source.db.Data} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:org.sonar.server.source.db.Data) + DataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return net.educoder.ecsonar.protobuf.DbFileSources.internal_static_org_sonar_server_source_db_Data_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return net.educoder.ecsonar.protobuf.DbFileSources.internal_static_org_sonar_server_source_db_Data_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Data.class, Builder.class); + } + + // Construct using net.educoder.ecsonar.protobuf.DbFileSources.Data.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getLinesFieldBuilder(); + } + } + @Override + public Builder clear() { + super.clear(); + if (linesBuilder_ == null) { + lines_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + linesBuilder_.clear(); + } + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return net.educoder.ecsonar.protobuf.DbFileSources.internal_static_org_sonar_server_source_db_Data_descriptor; + } + + @Override + public Data getDefaultInstanceForType() { + return Data.getDefaultInstance(); + } + + @Override + public Data build() { + Data result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public Data buildPartial() { + Data result = new Data(this); + int from_bitField0_ = bitField0_; + if (linesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + lines_ = java.util.Collections.unmodifiableList(lines_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.lines_ = lines_; + } else { + result.lines_ = linesBuilder_.build(); + } + onBuilt(); + return result; + } + + @Override + public Builder clone() { + return super.clone(); + } + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.setField(field, value); + } + @Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return super.setRepeatedField(field, index, value); + } + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.addRepeatedField(field, value); + } + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof Data) { + return mergeFrom((Data)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(Data other) { + if (other == Data.getDefaultInstance()) return this; + if (linesBuilder_ == null) { + if (!other.lines_.isEmpty()) { + if (lines_.isEmpty()) { + lines_ = other.lines_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLinesIsMutable(); + lines_.addAll(other.lines_); + } + onChanged(); + } + } else { + if (!other.lines_.isEmpty()) { + if (linesBuilder_.isEmpty()) { + linesBuilder_.dispose(); + linesBuilder_ = null; + lines_ = other.lines_; + bitField0_ = (bitField0_ & ~0x00000001); + linesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getLinesFieldBuilder() : null; + } else { + linesBuilder_.addAllMessages(other.lines_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + Data parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (Data) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List lines_ = + java.util.Collections.emptyList(); + private void ensureLinesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + lines_ = new java.util.ArrayList(lines_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Line, Line.Builder, LineOrBuilder> linesBuilder_; + + /** + * repeated .org.sonar.server.source.db.Line lines = 1; + */ + public java.util.List getLinesList() { + if (linesBuilder_ == null) { + return java.util.Collections.unmodifiableList(lines_); + } else { + return linesBuilder_.getMessageList(); + } + } + /** + * repeated .org.sonar.server.source.db.Line lines = 1; + */ + public int getLinesCount() { + if (linesBuilder_ == null) { + return lines_.size(); + } else { + return linesBuilder_.getCount(); + } + } + /** + * repeated .org.sonar.server.source.db.Line lines = 1; + */ + public Line getLines(int index) { + if (linesBuilder_ == null) { + return lines_.get(index); + } else { + return linesBuilder_.getMessage(index); + } + } + /** + * repeated .org.sonar.server.source.db.Line lines = 1; + */ + public Builder setLines( + int index, Line value) { + if (linesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinesIsMutable(); + lines_.set(index, value); + onChanged(); + } else { + linesBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .org.sonar.server.source.db.Line lines = 1; + */ + public Builder setLines( + int index, Line.Builder builderForValue) { + if (linesBuilder_ == null) { + ensureLinesIsMutable(); + lines_.set(index, builderForValue.build()); + onChanged(); + } else { + linesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .org.sonar.server.source.db.Line lines = 1; + */ + public Builder addLines(Line value) { + if (linesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinesIsMutable(); + lines_.add(value); + onChanged(); + } else { + linesBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .org.sonar.server.source.db.Line lines = 1; + */ + public Builder addLines( + int index, Line value) { + if (linesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLinesIsMutable(); + lines_.add(index, value); + onChanged(); + } else { + linesBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .org.sonar.server.source.db.Line lines = 1; + */ + public Builder addLines( + Line.Builder builderForValue) { + if (linesBuilder_ == null) { + ensureLinesIsMutable(); + lines_.add(builderForValue.build()); + onChanged(); + } else { + linesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .org.sonar.server.source.db.Line lines = 1; + */ + public Builder addLines( + int index, Line.Builder builderForValue) { + if (linesBuilder_ == null) { + ensureLinesIsMutable(); + lines_.add(index, builderForValue.build()); + onChanged(); + } else { + linesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .org.sonar.server.source.db.Line lines = 1; + */ + public Builder addAllLines( + Iterable values) { + if (linesBuilder_ == null) { + ensureLinesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, lines_); + onChanged(); + } else { + linesBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .org.sonar.server.source.db.Line lines = 1; + */ + public Builder clearLines() { + if (linesBuilder_ == null) { + lines_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + linesBuilder_.clear(); + } + return this; + } + /** + * repeated .org.sonar.server.source.db.Line lines = 1; + */ + public Builder removeLines(int index) { + if (linesBuilder_ == null) { + ensureLinesIsMutable(); + lines_.remove(index); + onChanged(); + } else { + linesBuilder_.remove(index); + } + return this; + } + /** + * repeated .org.sonar.server.source.db.Line lines = 1; + */ + public Line.Builder getLinesBuilder( + int index) { + return getLinesFieldBuilder().getBuilder(index); + } + /** + * repeated .org.sonar.server.source.db.Line lines = 1; + */ + @Override + public LineOrBuilder getLinesOrBuilder( + int index) { + if (linesBuilder_ == null) { + return lines_.get(index); } else { + return linesBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .org.sonar.server.source.db.Line lines = 1; + */ + @Override + public java.util.List + getLinesOrBuilderList() { + if (linesBuilder_ != null) { + return linesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(lines_); + } + } + /** + * repeated .org.sonar.server.source.db.Line lines = 1; + */ + public Line.Builder addLinesBuilder() { + return getLinesFieldBuilder().addBuilder( + Line.getDefaultInstance()); + } + /** + * repeated .org.sonar.server.source.db.Line lines = 1; + */ + public Line.Builder addLinesBuilder( + int index) { + return getLinesFieldBuilder().addBuilder( + index, Line.getDefaultInstance()); + } + /** + * repeated .org.sonar.server.source.db.Line lines = 1; + */ + public java.util.List + getLinesBuilderList() { + return getLinesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + Line, Line.Builder, LineOrBuilder> + getLinesFieldBuilder() { + if (linesBuilder_ == null) { + linesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + Line, Line.Builder, LineOrBuilder>( + lines_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + lines_ = null; + } + return linesBuilder_; + } + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:org.sonar.server.source.db.Data) + } + + // @@protoc_insertion_point(class_scope:org.sonar.server.source.db.Data) + private static final Data DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Data(); + } + + public static Data getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @Deprecated + public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @Override + public Data parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Data(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public Data getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_org_sonar_server_source_db_Line_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_org_sonar_server_source_db_Line_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_org_sonar_server_source_db_Range_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_org_sonar_server_source_db_Range_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_org_sonar_server_source_db_Data_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_org_sonar_server_source_db_Data_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + String[] descriptorData = { + "\n\025db-file-sources.proto\022\032org.sonar.serve" + + "r.source.db\"\316\004\n\004Line\022\014\n\004line\030\001 \001(\005\022\016\n\006so" + + "urce\030\002 \001(\t\022\024\n\014scm_revision\030\003 \001(\t\022\022\n\nscm_" + + "author\030\004 \001(\t\022\020\n\010scm_date\030\005 \001(\003\022\037\n\027deprec" + + "ated_ut_line_hits\030\006 \001(\005\022 \n\030deprecated_ut" + + "_conditions\030\007 \001(\005\022(\n deprecated_ut_cover" + + "ed_conditions\030\010 \001(\005\022\037\n\027deprecated_it_lin" + + "e_hits\030\t \001(\005\022 \n\030deprecated_it_conditions" + + "\030\n \001(\005\022(\n deprecated_it_covered_conditio" + + "ns\030\013 \001(\005\022$\n\034deprecated_overall_line_hits" + + "\030\014 \001(\005\022%\n\035deprecated_overall_conditions\030" + + "\r \001(\005\022-\n%deprecated_overall_covered_cond" + + "itions\030\016 \001(\005\022\024\n\014highlighting\030\017 \001(\t\022\017\n\007sy" + + "mbols\030\020 \001(\t\022\027\n\013duplication\030\021 \003(\005B\002\020\001\022\021\n\t" + + "line_hits\030\022 \001(\005\022\022\n\nconditions\030\023 \001(\005\022\032\n\022c" + + "overed_conditions\030\024 \001(\005\022\023\n\013is_new_line\030\025" + + " \001(\010\"/\n\005Range\022\023\n\013startOffset\030\001 \001(\005\022\021\n\ten" + + "dOffset\030\002 \001(\005\"7\n\004Data\022/\n\005lines\030\001 \003(\0132 .o" + + "rg.sonar.server.source.db.LineB!\n\035net.ed" + + "ucoder.ecsonar.protobufH\001" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_org_sonar_server_source_db_Line_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_org_sonar_server_source_db_Line_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_org_sonar_server_source_db_Line_descriptor, + new String[] { "Line", "Source", "ScmRevision", "ScmAuthor", "ScmDate", "DeprecatedUtLineHits", "DeprecatedUtConditions", "DeprecatedUtCoveredConditions", "DeprecatedItLineHits", "DeprecatedItConditions", "DeprecatedItCoveredConditions", "DeprecatedOverallLineHits", "DeprecatedOverallConditions", "DeprecatedOverallCoveredConditions", "Highlighting", "Symbols", "Duplication", "LineHits", "Conditions", "CoveredConditions", "IsNewLine", }); + internal_static_org_sonar_server_source_db_Range_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_org_sonar_server_source_db_Range_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_org_sonar_server_source_db_Range_descriptor, + new String[] { "StartOffset", "EndOffset", }); + internal_static_org_sonar_server_source_db_Data_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_org_sonar_server_source_db_Data_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_org_sonar_server_source_db_Data_descriptor, + new String[] { "Lines", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/main/java/net/educoder/ecsonar/protobuf/DbIssues.java b/src/main/java/net/educoder/ecsonar/protobuf/DbIssues.java new file mode 100644 index 0000000..4a661df --- /dev/null +++ b/src/main/java/net/educoder/ecsonar/protobuf/DbIssues.java @@ -0,0 +1,2940 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: db-issues.proto + +package net.educoder.ecsonar.protobuf; + +public final class DbIssues { + private DbIssues() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface LocationsOrBuilder extends + // @@protoc_insertion_point(interface_extends:sonarqube.db.issues.Locations) + com.google.protobuf.MessageOrBuilder { + + /** + * optional .sonarqube.db.commons.TextRange text_range = 1; + * @return Whether the textRange field is set. + */ + boolean hasTextRange(); + /** + * optional .sonarqube.db.commons.TextRange text_range = 1; + * @return The textRange. + */ + DbCommons.TextRange getTextRange(); + /** + * optional .sonarqube.db.commons.TextRange text_range = 1; + */ + DbCommons.TextRangeOrBuilder getTextRangeOrBuilder(); + + /** + * repeated .sonarqube.db.issues.Flow flow = 2; + */ + java.util.List + getFlowList(); + /** + * repeated .sonarqube.db.issues.Flow flow = 2; + */ + Flow getFlow(int index); + /** + * repeated .sonarqube.db.issues.Flow flow = 2; + */ + int getFlowCount(); + /** + * repeated .sonarqube.db.issues.Flow flow = 2; + */ + java.util.List + getFlowOrBuilderList(); + /** + * repeated .sonarqube.db.issues.Flow flow = 2; + */ + FlowOrBuilder getFlowOrBuilder( + int index); + } + /** + * Protobuf type {@code sonarqube.db.issues.Locations} + */ + public static final class Locations extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:sonarqube.db.issues.Locations) + LocationsOrBuilder { + private static final long serialVersionUID = 0L; + // Use Locations.newBuilder() to construct. + private Locations(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Locations() { + flow_ = java.util.Collections.emptyList(); + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance( + UnusedPrivateParameter unused) { + return new Locations(); + } + + @Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Locations( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + DbCommons.TextRange.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) != 0)) { + subBuilder = textRange_.toBuilder(); + } + textRange_ = input.readMessage(DbCommons.TextRange.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(textRange_); + textRange_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + flow_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + flow_.add( + input.readMessage(Flow.PARSER, extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000002) != 0)) { + flow_ = java.util.Collections.unmodifiableList(flow_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return net.educoder.ecsonar.protobuf.DbIssues.internal_static_sonarqube_db_issues_Locations_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return net.educoder.ecsonar.protobuf.DbIssues.internal_static_sonarqube_db_issues_Locations_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Locations.class, Builder.class); + } + + private int bitField0_; + public static final int TEXT_RANGE_FIELD_NUMBER = 1; + private DbCommons.TextRange textRange_; + /** + * optional .sonarqube.db.commons.TextRange text_range = 1; + * @return Whether the textRange field is set. + */ + @Override + public boolean hasTextRange() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional .sonarqube.db.commons.TextRange text_range = 1; + * @return The textRange. + */ + @Override + public DbCommons.TextRange getTextRange() { + return textRange_ == null ? DbCommons.TextRange.getDefaultInstance() : textRange_; + } + /** + * optional .sonarqube.db.commons.TextRange text_range = 1; + */ + @Override + public DbCommons.TextRangeOrBuilder getTextRangeOrBuilder() { + return textRange_ == null ? DbCommons.TextRange.getDefaultInstance() : textRange_; + } + + public static final int FLOW_FIELD_NUMBER = 2; + private java.util.List flow_; + /** + * repeated .sonarqube.db.issues.Flow flow = 2; + */ + @Override + public java.util.List getFlowList() { + return flow_; + } + /** + * repeated .sonarqube.db.issues.Flow flow = 2; + */ + @Override + public java.util.List + getFlowOrBuilderList() { + return flow_; + } + /** + * repeated .sonarqube.db.issues.Flow flow = 2; + */ + @Override + public int getFlowCount() { + return flow_.size(); + } + /** + * repeated .sonarqube.db.issues.Flow flow = 2; + */ + @Override + public Flow getFlow(int index) { + return flow_.get(index); + } + /** + * repeated .sonarqube.db.issues.Flow flow = 2; + */ + @Override + public FlowOrBuilder getFlowOrBuilder( + int index) { + return flow_.get(index); + } + + private byte memoizedIsInitialized = -1; + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getTextRange()); + } + for (int i = 0; i < flow_.size(); i++) { + output.writeMessage(2, flow_.get(i)); + } + unknownFields.writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getTextRange()); + } + for (int i = 0; i < flow_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, flow_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Locations)) { + return super.equals(obj); + } + Locations other = (Locations) obj; + + if (hasTextRange() != other.hasTextRange()) return false; + if (hasTextRange()) { + if (!getTextRange() + .equals(other.getTextRange())) return false; + } + if (!getFlowList() + .equals(other.getFlowList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasTextRange()) { + hash = (37 * hash) + TEXT_RANGE_FIELD_NUMBER; + hash = (53 * hash) + getTextRange().hashCode(); + } + if (getFlowCount() > 0) { + hash = (37 * hash) + FLOW_FIELD_NUMBER; + hash = (53 * hash) + getFlowList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static Locations parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Locations parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Locations parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Locations parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Locations parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Locations parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Locations parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static Locations parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static Locations parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static Locations parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static Locations parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static Locations parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Locations prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType( + BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code sonarqube.db.issues.Locations} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:sonarqube.db.issues.Locations) + LocationsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return net.educoder.ecsonar.protobuf.DbIssues.internal_static_sonarqube_db_issues_Locations_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return net.educoder.ecsonar.protobuf.DbIssues.internal_static_sonarqube_db_issues_Locations_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Locations.class, Builder.class); + } + + // Construct using net.educoder.ecsonar.protobuf.DbIssues.Locations.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getTextRangeFieldBuilder(); + getFlowFieldBuilder(); + } + } + @Override + public Builder clear() { + super.clear(); + if (textRangeBuilder_ == null) { + textRange_ = null; + } else { + textRangeBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (flowBuilder_ == null) { + flow_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + flowBuilder_.clear(); + } + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return net.educoder.ecsonar.protobuf.DbIssues.internal_static_sonarqube_db_issues_Locations_descriptor; + } + + @Override + public Locations getDefaultInstanceForType() { + return Locations.getDefaultInstance(); + } + + @Override + public Locations build() { + Locations result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public Locations buildPartial() { + Locations result = new Locations(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + if (textRangeBuilder_ == null) { + result.textRange_ = textRange_; + } else { + result.textRange_ = textRangeBuilder_.build(); + } + to_bitField0_ |= 0x00000001; + } + if (flowBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + flow_ = java.util.Collections.unmodifiableList(flow_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.flow_ = flow_; + } else { + result.flow_ = flowBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @Override + public Builder clone() { + return super.clone(); + } + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.setField(field, value); + } + @Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return super.setRepeatedField(field, index, value); + } + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.addRepeatedField(field, value); + } + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof Locations) { + return mergeFrom((Locations)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(Locations other) { + if (other == Locations.getDefaultInstance()) return this; + if (other.hasTextRange()) { + mergeTextRange(other.getTextRange()); + } + if (flowBuilder_ == null) { + if (!other.flow_.isEmpty()) { + if (flow_.isEmpty()) { + flow_ = other.flow_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureFlowIsMutable(); + flow_.addAll(other.flow_); + } + onChanged(); + } + } else { + if (!other.flow_.isEmpty()) { + if (flowBuilder_.isEmpty()) { + flowBuilder_.dispose(); + flowBuilder_ = null; + flow_ = other.flow_; + bitField0_ = (bitField0_ & ~0x00000002); + flowBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getFlowFieldBuilder() : null; + } else { + flowBuilder_.addAllMessages(other.flow_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + Locations parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (Locations) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private DbCommons.TextRange textRange_; + private com.google.protobuf.SingleFieldBuilderV3< + DbCommons.TextRange, DbCommons.TextRange.Builder, DbCommons.TextRangeOrBuilder> textRangeBuilder_; + /** + * optional .sonarqube.db.commons.TextRange text_range = 1; + * @return Whether the textRange field is set. + */ + public boolean hasTextRange() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional .sonarqube.db.commons.TextRange text_range = 1; + * @return The textRange. + */ + public DbCommons.TextRange getTextRange() { + if (textRangeBuilder_ == null) { + return textRange_ == null ? DbCommons.TextRange.getDefaultInstance() : textRange_; + } else { + return textRangeBuilder_.getMessage(); + } + } + /** + * optional .sonarqube.db.commons.TextRange text_range = 1; + */ + public Builder setTextRange(DbCommons.TextRange value) { + if (textRangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + textRange_ = value; + onChanged(); + } else { + textRangeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * optional .sonarqube.db.commons.TextRange text_range = 1; + */ + public Builder setTextRange( + DbCommons.TextRange.Builder builderForValue) { + if (textRangeBuilder_ == null) { + textRange_ = builderForValue.build(); + onChanged(); + } else { + textRangeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * optional .sonarqube.db.commons.TextRange text_range = 1; + */ + public Builder mergeTextRange(DbCommons.TextRange value) { + if (textRangeBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + textRange_ != null && + textRange_ != DbCommons.TextRange.getDefaultInstance()) { + textRange_ = + DbCommons.TextRange.newBuilder(textRange_).mergeFrom(value).buildPartial(); + } else { + textRange_ = value; + } + onChanged(); + } else { + textRangeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + return this; + } + /** + * optional .sonarqube.db.commons.TextRange text_range = 1; + */ + public Builder clearTextRange() { + if (textRangeBuilder_ == null) { + textRange_ = null; + onChanged(); + } else { + textRangeBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + /** + * optional .sonarqube.db.commons.TextRange text_range = 1; + */ + public DbCommons.TextRange.Builder getTextRangeBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getTextRangeFieldBuilder().getBuilder(); + } + /** + * optional .sonarqube.db.commons.TextRange text_range = 1; + */ + public DbCommons.TextRangeOrBuilder getTextRangeOrBuilder() { + if (textRangeBuilder_ != null) { + return textRangeBuilder_.getMessageOrBuilder(); + } else { + return textRange_ == null ? + DbCommons.TextRange.getDefaultInstance() : textRange_; + } + } + /** + * optional .sonarqube.db.commons.TextRange text_range = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + DbCommons.TextRange, DbCommons.TextRange.Builder, DbCommons.TextRangeOrBuilder> + getTextRangeFieldBuilder() { + if (textRangeBuilder_ == null) { + textRangeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + DbCommons.TextRange, DbCommons.TextRange.Builder, DbCommons.TextRangeOrBuilder>( + getTextRange(), + getParentForChildren(), + isClean()); + textRange_ = null; + } + return textRangeBuilder_; + } + + private java.util.List flow_ = + java.util.Collections.emptyList(); + private void ensureFlowIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + flow_ = new java.util.ArrayList(flow_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Flow, Flow.Builder, FlowOrBuilder> flowBuilder_; + + /** + * repeated .sonarqube.db.issues.Flow flow = 2; + */ + public java.util.List getFlowList() { + if (flowBuilder_ == null) { + return java.util.Collections.unmodifiableList(flow_); + } else { + return flowBuilder_.getMessageList(); + } + } + /** + * repeated .sonarqube.db.issues.Flow flow = 2; + */ + public int getFlowCount() { + if (flowBuilder_ == null) { + return flow_.size(); + } else { + return flowBuilder_.getCount(); + } + } + /** + * repeated .sonarqube.db.issues.Flow flow = 2; + */ + public Flow getFlow(int index) { + if (flowBuilder_ == null) { + return flow_.get(index); + } else { + return flowBuilder_.getMessage(index); + } + } + /** + * repeated .sonarqube.db.issues.Flow flow = 2; + */ + public Builder setFlow( + int index, Flow value) { + if (flowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFlowIsMutable(); + flow_.set(index, value); + onChanged(); + } else { + flowBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .sonarqube.db.issues.Flow flow = 2; + */ + public Builder setFlow( + int index, Flow.Builder builderForValue) { + if (flowBuilder_ == null) { + ensureFlowIsMutable(); + flow_.set(index, builderForValue.build()); + onChanged(); + } else { + flowBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .sonarqube.db.issues.Flow flow = 2; + */ + public Builder addFlow(Flow value) { + if (flowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFlowIsMutable(); + flow_.add(value); + onChanged(); + } else { + flowBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .sonarqube.db.issues.Flow flow = 2; + */ + public Builder addFlow( + int index, Flow value) { + if (flowBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFlowIsMutable(); + flow_.add(index, value); + onChanged(); + } else { + flowBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .sonarqube.db.issues.Flow flow = 2; + */ + public Builder addFlow( + Flow.Builder builderForValue) { + if (flowBuilder_ == null) { + ensureFlowIsMutable(); + flow_.add(builderForValue.build()); + onChanged(); + } else { + flowBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .sonarqube.db.issues.Flow flow = 2; + */ + public Builder addFlow( + int index, Flow.Builder builderForValue) { + if (flowBuilder_ == null) { + ensureFlowIsMutable(); + flow_.add(index, builderForValue.build()); + onChanged(); + } else { + flowBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .sonarqube.db.issues.Flow flow = 2; + */ + public Builder addAllFlow( + Iterable values) { + if (flowBuilder_ == null) { + ensureFlowIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, flow_); + onChanged(); + } else { + flowBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .sonarqube.db.issues.Flow flow = 2; + */ + public Builder clearFlow() { + if (flowBuilder_ == null) { + flow_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + flowBuilder_.clear(); + } + return this; + } + /** + * repeated .sonarqube.db.issues.Flow flow = 2; + */ + public Builder removeFlow(int index) { + if (flowBuilder_ == null) { + ensureFlowIsMutable(); + flow_.remove(index); + onChanged(); + } else { + flowBuilder_.remove(index); + } + return this; + } + /** + * repeated .sonarqube.db.issues.Flow flow = 2; + */ + public Flow.Builder getFlowBuilder( + int index) { + return getFlowFieldBuilder().getBuilder(index); + } + /** + * repeated .sonarqube.db.issues.Flow flow = 2; + */ + public FlowOrBuilder getFlowOrBuilder( + int index) { + if (flowBuilder_ == null) { + return flow_.get(index); } else { + return flowBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .sonarqube.db.issues.Flow flow = 2; + */ + public java.util.List + getFlowOrBuilderList() { + if (flowBuilder_ != null) { + return flowBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(flow_); + } + } + /** + * repeated .sonarqube.db.issues.Flow flow = 2; + */ + public Flow.Builder addFlowBuilder() { + return getFlowFieldBuilder().addBuilder( + Flow.getDefaultInstance()); + } + /** + * repeated .sonarqube.db.issues.Flow flow = 2; + */ + public Flow.Builder addFlowBuilder( + int index) { + return getFlowFieldBuilder().addBuilder( + index, Flow.getDefaultInstance()); + } + /** + * repeated .sonarqube.db.issues.Flow flow = 2; + */ + public java.util.List + getFlowBuilderList() { + return getFlowFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + Flow, Flow.Builder, FlowOrBuilder> + getFlowFieldBuilder() { + if (flowBuilder_ == null) { + flowBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + Flow, Flow.Builder, FlowOrBuilder>( + flow_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + flow_ = null; + } + return flowBuilder_; + } + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:sonarqube.db.issues.Locations) + } + + // @@protoc_insertion_point(class_scope:sonarqube.db.issues.Locations) + private static final Locations DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Locations(); + } + + public static Locations getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @Deprecated + public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @Override + public Locations parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Locations(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public Locations getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface FlowOrBuilder extends + // @@protoc_insertion_point(interface_extends:sonarqube.db.issues.Flow) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .sonarqube.db.issues.Location location = 1; + */ + java.util.List + getLocationList(); + /** + * repeated .sonarqube.db.issues.Location location = 1; + */ + Location getLocation(int index); + /** + * repeated .sonarqube.db.issues.Location location = 1; + */ + int getLocationCount(); + /** + * repeated .sonarqube.db.issues.Location location = 1; + */ + java.util.List + getLocationOrBuilderList(); + /** + * repeated .sonarqube.db.issues.Location location = 1; + */ + LocationOrBuilder getLocationOrBuilder( + int index); + } + /** + * Protobuf type {@code sonarqube.db.issues.Flow} + */ + public static final class Flow extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:sonarqube.db.issues.Flow) + FlowOrBuilder { + private static final long serialVersionUID = 0L; + // Use Flow.newBuilder() to construct. + private Flow(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Flow() { + location_ = java.util.Collections.emptyList(); + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance( + UnusedPrivateParameter unused) { + return new Flow(); + } + + @Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Flow( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + location_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + location_.add( + input.readMessage(Location.PARSER, extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + location_ = java.util.Collections.unmodifiableList(location_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return net.educoder.ecsonar.protobuf.DbIssues.internal_static_sonarqube_db_issues_Flow_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return net.educoder.ecsonar.protobuf.DbIssues.internal_static_sonarqube_db_issues_Flow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Flow.class, Builder.class); + } + + public static final int LOCATION_FIELD_NUMBER = 1; + private java.util.List location_; + /** + * repeated .sonarqube.db.issues.Location location = 1; + */ + @Override + public java.util.List getLocationList() { + return location_; + } + /** + * repeated .sonarqube.db.issues.Location location = 1; + */ + @Override + public java.util.List + getLocationOrBuilderList() { + return location_; + } + /** + * repeated .sonarqube.db.issues.Location location = 1; + */ + @Override + public int getLocationCount() { + return location_.size(); + } + /** + * repeated .sonarqube.db.issues.Location location = 1; + */ + @Override + public Location getLocation(int index) { + return location_.get(index); + } + /** + * repeated .sonarqube.db.issues.Location location = 1; + */ + @Override + public LocationOrBuilder getLocationOrBuilder( + int index) { + return location_.get(index); + } + + private byte memoizedIsInitialized = -1; + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < location_.size(); i++) { + output.writeMessage(1, location_.get(i)); + } + unknownFields.writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < location_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, location_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Flow)) { + return super.equals(obj); + } + Flow other = (Flow) obj; + + if (!getLocationList() + .equals(other.getLocationList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getLocationCount() > 0) { + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocationList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static Flow parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Flow parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Flow parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Flow parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Flow parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Flow parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Flow parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static Flow parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static Flow parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static Flow parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static Flow parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static Flow parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Flow prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType( + BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code sonarqube.db.issues.Flow} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:sonarqube.db.issues.Flow) + FlowOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return net.educoder.ecsonar.protobuf.DbIssues.internal_static_sonarqube_db_issues_Flow_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return net.educoder.ecsonar.protobuf.DbIssues.internal_static_sonarqube_db_issues_Flow_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Flow.class, Builder.class); + } + + // Construct using net.educoder.ecsonar.protobuf.DbIssues.Flow.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getLocationFieldBuilder(); + } + } + @Override + public Builder clear() { + super.clear(); + if (locationBuilder_ == null) { + location_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + locationBuilder_.clear(); + } + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return net.educoder.ecsonar.protobuf.DbIssues.internal_static_sonarqube_db_issues_Flow_descriptor; + } + + @Override + public Flow getDefaultInstanceForType() { + return Flow.getDefaultInstance(); + } + + @Override + public Flow build() { + Flow result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public Flow buildPartial() { + Flow result = new Flow(this); + int from_bitField0_ = bitField0_; + if (locationBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + location_ = java.util.Collections.unmodifiableList(location_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.location_ = location_; + } else { + result.location_ = locationBuilder_.build(); + } + onBuilt(); + return result; + } + + @Override + public Builder clone() { + return super.clone(); + } + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.setField(field, value); + } + @Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return super.setRepeatedField(field, index, value); + } + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.addRepeatedField(field, value); + } + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof Flow) { + return mergeFrom((Flow)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(Flow other) { + if (other == Flow.getDefaultInstance()) return this; + if (locationBuilder_ == null) { + if (!other.location_.isEmpty()) { + if (location_.isEmpty()) { + location_ = other.location_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLocationIsMutable(); + location_.addAll(other.location_); + } + onChanged(); + } + } else { + if (!other.location_.isEmpty()) { + if (locationBuilder_.isEmpty()) { + locationBuilder_.dispose(); + locationBuilder_ = null; + location_ = other.location_; + bitField0_ = (bitField0_ & ~0x00000001); + locationBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getLocationFieldBuilder() : null; + } else { + locationBuilder_.addAllMessages(other.location_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + Flow parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (Flow) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List location_ = + java.util.Collections.emptyList(); + private void ensureLocationIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + location_ = new java.util.ArrayList(location_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + Location, Location.Builder, LocationOrBuilder> locationBuilder_; + + /** + * repeated .sonarqube.db.issues.Location location = 1; + */ + public java.util.List getLocationList() { + if (locationBuilder_ == null) { + return java.util.Collections.unmodifiableList(location_); + } else { + return locationBuilder_.getMessageList(); + } + } + /** + * repeated .sonarqube.db.issues.Location location = 1; + */ + public int getLocationCount() { + if (locationBuilder_ == null) { + return location_.size(); + } else { + return locationBuilder_.getCount(); + } + } + /** + * repeated .sonarqube.db.issues.Location location = 1; + */ + public Location getLocation(int index) { + if (locationBuilder_ == null) { + return location_.get(index); + } else { + return locationBuilder_.getMessage(index); + } + } + /** + * repeated .sonarqube.db.issues.Location location = 1; + */ + public Builder setLocation( + int index, Location value) { + if (locationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocationIsMutable(); + location_.set(index, value); + onChanged(); + } else { + locationBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .sonarqube.db.issues.Location location = 1; + */ + public Builder setLocation( + int index, Location.Builder builderForValue) { + if (locationBuilder_ == null) { + ensureLocationIsMutable(); + location_.set(index, builderForValue.build()); + onChanged(); + } else { + locationBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .sonarqube.db.issues.Location location = 1; + */ + public Builder addLocation(Location value) { + if (locationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocationIsMutable(); + location_.add(value); + onChanged(); + } else { + locationBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .sonarqube.db.issues.Location location = 1; + */ + public Builder addLocation( + int index, Location value) { + if (locationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLocationIsMutable(); + location_.add(index, value); + onChanged(); + } else { + locationBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .sonarqube.db.issues.Location location = 1; + */ + public Builder addLocation( + Location.Builder builderForValue) { + if (locationBuilder_ == null) { + ensureLocationIsMutable(); + location_.add(builderForValue.build()); + onChanged(); + } else { + locationBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .sonarqube.db.issues.Location location = 1; + */ + public Builder addLocation( + int index, Location.Builder builderForValue) { + if (locationBuilder_ == null) { + ensureLocationIsMutable(); + location_.add(index, builderForValue.build()); + onChanged(); + } else { + locationBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .sonarqube.db.issues.Location location = 1; + */ + public Builder addAllLocation( + Iterable values) { + if (locationBuilder_ == null) { + ensureLocationIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, location_); + onChanged(); + } else { + locationBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .sonarqube.db.issues.Location location = 1; + */ + public Builder clearLocation() { + if (locationBuilder_ == null) { + location_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + locationBuilder_.clear(); + } + return this; + } + /** + * repeated .sonarqube.db.issues.Location location = 1; + */ + public Builder removeLocation(int index) { + if (locationBuilder_ == null) { + ensureLocationIsMutable(); + location_.remove(index); + onChanged(); + } else { + locationBuilder_.remove(index); + } + return this; + } + /** + * repeated .sonarqube.db.issues.Location location = 1; + */ + public Location.Builder getLocationBuilder( + int index) { + return getLocationFieldBuilder().getBuilder(index); + } + /** + * repeated .sonarqube.db.issues.Location location = 1; + */ + public LocationOrBuilder getLocationOrBuilder( + int index) { + if (locationBuilder_ == null) { + return location_.get(index); } else { + return locationBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .sonarqube.db.issues.Location location = 1; + */ + public java.util.List + getLocationOrBuilderList() { + if (locationBuilder_ != null) { + return locationBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(location_); + } + } + /** + * repeated .sonarqube.db.issues.Location location = 1; + */ + public Location.Builder addLocationBuilder() { + return getLocationFieldBuilder().addBuilder( + Location.getDefaultInstance()); + } + /** + * repeated .sonarqube.db.issues.Location location = 1; + */ + public Location.Builder addLocationBuilder( + int index) { + return getLocationFieldBuilder().addBuilder( + index, Location.getDefaultInstance()); + } + /** + * repeated .sonarqube.db.issues.Location location = 1; + */ + public java.util.List + getLocationBuilderList() { + return getLocationFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + Location, Location.Builder, LocationOrBuilder> + getLocationFieldBuilder() { + if (locationBuilder_ == null) { + locationBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + Location, Location.Builder, LocationOrBuilder>( + location_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + location_ = null; + } + return locationBuilder_; + } + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:sonarqube.db.issues.Flow) + } + + // @@protoc_insertion_point(class_scope:sonarqube.db.issues.Flow) + private static final Flow DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Flow(); + } + + public static Flow getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @Deprecated + public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @Override + public Flow parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Flow(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public Flow getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface LocationOrBuilder extends + // @@protoc_insertion_point(interface_extends:sonarqube.db.issues.Location) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string component_id = 1; + * @return Whether the componentId field is set. + */ + boolean hasComponentId(); + /** + * optional string component_id = 1; + * @return The componentId. + */ + String getComponentId(); + /** + * optional string component_id = 1; + * @return The bytes for componentId. + */ + com.google.protobuf.ByteString + getComponentIdBytes(); + + /** + *
+     * Only when component is a file. Can be empty for a file if this is an issue global to the file.
+     * 
+ * + * optional .sonarqube.db.commons.TextRange text_range = 2; + * @return Whether the textRange field is set. + */ + boolean hasTextRange(); + /** + *
+     * Only when component is a file. Can be empty for a file if this is an issue global to the file.
+     * 
+ * + * optional .sonarqube.db.commons.TextRange text_range = 2; + * @return The textRange. + */ + DbCommons.TextRange getTextRange(); + /** + *
+     * Only when component is a file. Can be empty for a file if this is an issue global to the file.
+     * 
+ * + * optional .sonarqube.db.commons.TextRange text_range = 2; + */ + DbCommons.TextRangeOrBuilder getTextRangeOrBuilder(); + + /** + * optional string msg = 3; + * @return Whether the msg field is set. + */ + boolean hasMsg(); + /** + * optional string msg = 3; + * @return The msg. + */ + String getMsg(); + /** + * optional string msg = 3; + * @return The bytes for msg. + */ + com.google.protobuf.ByteString + getMsgBytes(); + } + /** + * Protobuf type {@code sonarqube.db.issues.Location} + */ + public static final class Location extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:sonarqube.db.issues.Location) + LocationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Location.newBuilder() to construct. + private Location(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Location() { + componentId_ = ""; + msg_ = ""; + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance( + UnusedPrivateParameter unused) { + return new Location(); + } + + @Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Location( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000001; + componentId_ = bs; + break; + } + case 18: { + DbCommons.TextRange.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) != 0)) { + subBuilder = textRange_.toBuilder(); + } + textRange_ = input.readMessage(DbCommons.TextRange.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(textRange_); + textRange_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + break; + } + case 26: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000004; + msg_ = bs; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return net.educoder.ecsonar.protobuf.DbIssues.internal_static_sonarqube_db_issues_Location_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return net.educoder.ecsonar.protobuf.DbIssues.internal_static_sonarqube_db_issues_Location_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Location.class, Builder.class); + } + + private int bitField0_; + public static final int COMPONENT_ID_FIELD_NUMBER = 1; + private volatile Object componentId_; + /** + * optional string component_id = 1; + * @return Whether the componentId field is set. + */ + @Override + public boolean hasComponentId() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string component_id = 1; + * @return The componentId. + */ + @Override + public String getComponentId() { + Object ref = componentId_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + componentId_ = s; + } + return s; + } + } + /** + * optional string component_id = 1; + * @return The bytes for componentId. + */ + @Override + public com.google.protobuf.ByteString + getComponentIdBytes() { + Object ref = componentId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + componentId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TEXT_RANGE_FIELD_NUMBER = 2; + private DbCommons.TextRange textRange_; + /** + *
+     * Only when component is a file. Can be empty for a file if this is an issue global to the file.
+     * 
+ * + * optional .sonarqube.db.commons.TextRange text_range = 2; + * @return Whether the textRange field is set. + */ + @Override + public boolean hasTextRange() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+     * Only when component is a file. Can be empty for a file if this is an issue global to the file.
+     * 
+ * + * optional .sonarqube.db.commons.TextRange text_range = 2; + * @return The textRange. + */ + @Override + public DbCommons.TextRange getTextRange() { + return textRange_ == null ? DbCommons.TextRange.getDefaultInstance() : textRange_; + } + /** + *
+     * Only when component is a file. Can be empty for a file if this is an issue global to the file.
+     * 
+ * + * optional .sonarqube.db.commons.TextRange text_range = 2; + */ + @Override + public DbCommons.TextRangeOrBuilder getTextRangeOrBuilder() { + return textRange_ == null ? DbCommons.TextRange.getDefaultInstance() : textRange_; + } + + public static final int MSG_FIELD_NUMBER = 3; + private volatile Object msg_; + /** + * optional string msg = 3; + * @return Whether the msg field is set. + */ + @Override + public boolean hasMsg() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * optional string msg = 3; + * @return The msg. + */ + @Override + public String getMsg() { + Object ref = msg_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + msg_ = s; + } + return s; + } + } + /** + * optional string msg = 3; + * @return The bytes for msg. + */ + @Override + public com.google.protobuf.ByteString + getMsgBytes() { + Object ref = msg_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + msg_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, componentId_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getTextRange()); + } + if (((bitField0_ & 0x00000004) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, msg_); + } + unknownFields.writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, componentId_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getTextRange()); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, msg_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof Location)) { + return super.equals(obj); + } + Location other = (Location) obj; + + if (hasComponentId() != other.hasComponentId()) return false; + if (hasComponentId()) { + if (!getComponentId() + .equals(other.getComponentId())) return false; + } + if (hasTextRange() != other.hasTextRange()) return false; + if (hasTextRange()) { + if (!getTextRange() + .equals(other.getTextRange())) return false; + } + if (hasMsg() != other.hasMsg()) return false; + if (hasMsg()) { + if (!getMsg() + .equals(other.getMsg())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasComponentId()) { + hash = (37 * hash) + COMPONENT_ID_FIELD_NUMBER; + hash = (53 * hash) + getComponentId().hashCode(); + } + if (hasTextRange()) { + hash = (37 * hash) + TEXT_RANGE_FIELD_NUMBER; + hash = (53 * hash) + getTextRange().hashCode(); + } + if (hasMsg()) { + hash = (37 * hash) + MSG_FIELD_NUMBER; + hash = (53 * hash) + getMsg().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static Location parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Location parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Location parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Location parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Location parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static Location parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static Location parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static Location parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static Location parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static Location parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static Location parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static Location parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(Location prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType( + BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code sonarqube.db.issues.Location} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:sonarqube.db.issues.Location) + LocationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return net.educoder.ecsonar.protobuf.DbIssues.internal_static_sonarqube_db_issues_Location_descriptor; + } + + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return net.educoder.ecsonar.protobuf.DbIssues.internal_static_sonarqube_db_issues_Location_fieldAccessorTable + .ensureFieldAccessorsInitialized( + Location.class, Builder.class); + } + + // Construct using net.educoder.ecsonar.protobuf.DbIssues.Location.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getTextRangeFieldBuilder(); + } + } + @Override + public Builder clear() { + super.clear(); + componentId_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + if (textRangeBuilder_ == null) { + textRange_ = null; + } else { + textRangeBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + msg_ = ""; + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return net.educoder.ecsonar.protobuf.DbIssues.internal_static_sonarqube_db_issues_Location_descriptor; + } + + @Override + public Location getDefaultInstanceForType() { + return Location.getDefaultInstance(); + } + + @Override + public Location build() { + Location result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public Location buildPartial() { + Location result = new Location(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + to_bitField0_ |= 0x00000001; + } + result.componentId_ = componentId_; + if (((from_bitField0_ & 0x00000002) != 0)) { + if (textRangeBuilder_ == null) { + result.textRange_ = textRange_; + } else { + result.textRange_ = textRangeBuilder_.build(); + } + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + to_bitField0_ |= 0x00000004; + } + result.msg_ = msg_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @Override + public Builder clone() { + return super.clone(); + } + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.setField(field, value); + } + @Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return super.setRepeatedField(field, index, value); + } + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.addRepeatedField(field, value); + } + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof Location) { + return mergeFrom((Location)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(Location other) { + if (other == Location.getDefaultInstance()) return this; + if (other.hasComponentId()) { + bitField0_ |= 0x00000001; + componentId_ = other.componentId_; + onChanged(); + } + if (other.hasTextRange()) { + mergeTextRange(other.getTextRange()); + } + if (other.hasMsg()) { + bitField0_ |= 0x00000004; + msg_ = other.msg_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + Location parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (Location) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private Object componentId_ = ""; + /** + * optional string component_id = 1; + * @return Whether the componentId field is set. + */ + public boolean hasComponentId() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string component_id = 1; + * @return The componentId. + */ + public String getComponentId() { + Object ref = componentId_; + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + componentId_ = s; + } + return s; + } else { + return (String) ref; + } + } + /** + * optional string component_id = 1; + * @return The bytes for componentId. + */ + public com.google.protobuf.ByteString + getComponentIdBytes() { + Object ref = componentId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + componentId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string component_id = 1; + * @param value The componentId to set. + * @return This builder for chaining. + */ + public Builder setComponentId( + String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + componentId_ = value; + onChanged(); + return this; + } + /** + * optional string component_id = 1; + * @return This builder for chaining. + */ + public Builder clearComponentId() { + bitField0_ = (bitField0_ & ~0x00000001); + componentId_ = getDefaultInstance().getComponentId(); + onChanged(); + return this; + } + /** + * optional string component_id = 1; + * @param value The bytes for componentId to set. + * @return This builder for chaining. + */ + public Builder setComponentIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + componentId_ = value; + onChanged(); + return this; + } + + private DbCommons.TextRange textRange_; + private com.google.protobuf.SingleFieldBuilderV3< + DbCommons.TextRange, DbCommons.TextRange.Builder, DbCommons.TextRangeOrBuilder> textRangeBuilder_; + /** + *
+       * Only when component is a file. Can be empty for a file if this is an issue global to the file.
+       * 
+ * + * optional .sonarqube.db.commons.TextRange text_range = 2; + * @return Whether the textRange field is set. + */ + public boolean hasTextRange() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + *
+       * Only when component is a file. Can be empty for a file if this is an issue global to the file.
+       * 
+ * + * optional .sonarqube.db.commons.TextRange text_range = 2; + * @return The textRange. + */ + public DbCommons.TextRange getTextRange() { + if (textRangeBuilder_ == null) { + return textRange_ == null ? DbCommons.TextRange.getDefaultInstance() : textRange_; + } else { + return textRangeBuilder_.getMessage(); + } + } + /** + *
+       * Only when component is a file. Can be empty for a file if this is an issue global to the file.
+       * 
+ * + * optional .sonarqube.db.commons.TextRange text_range = 2; + */ + public Builder setTextRange(DbCommons.TextRange value) { + if (textRangeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + textRange_ = value; + onChanged(); + } else { + textRangeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + *
+       * Only when component is a file. Can be empty for a file if this is an issue global to the file.
+       * 
+ * + * optional .sonarqube.db.commons.TextRange text_range = 2; + */ + public Builder setTextRange( + DbCommons.TextRange.Builder builderForValue) { + if (textRangeBuilder_ == null) { + textRange_ = builderForValue.build(); + onChanged(); + } else { + textRangeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + return this; + } + /** + *
+       * Only when component is a file. Can be empty for a file if this is an issue global to the file.
+       * 
+ * + * optional .sonarqube.db.commons.TextRange text_range = 2; + */ + public Builder mergeTextRange(DbCommons.TextRange value) { + if (textRangeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) && + textRange_ != null && + textRange_ != DbCommons.TextRange.getDefaultInstance()) { + textRange_ = + DbCommons.TextRange.newBuilder(textRange_).mergeFrom(value).buildPartial(); + } else { + textRange_ = value; + } + onChanged(); + } else { + textRangeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + return this; + } + /** + *
+       * Only when component is a file. Can be empty for a file if this is an issue global to the file.
+       * 
+ * + * optional .sonarqube.db.commons.TextRange text_range = 2; + */ + public Builder clearTextRange() { + if (textRangeBuilder_ == null) { + textRange_ = null; + onChanged(); + } else { + textRangeBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + /** + *
+       * Only when component is a file. Can be empty for a file if this is an issue global to the file.
+       * 
+ * + * optional .sonarqube.db.commons.TextRange text_range = 2; + */ + public DbCommons.TextRange.Builder getTextRangeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getTextRangeFieldBuilder().getBuilder(); + } + /** + *
+       * Only when component is a file. Can be empty for a file if this is an issue global to the file.
+       * 
+ * + * optional .sonarqube.db.commons.TextRange text_range = 2; + */ + public DbCommons.TextRangeOrBuilder getTextRangeOrBuilder() { + if (textRangeBuilder_ != null) { + return textRangeBuilder_.getMessageOrBuilder(); + } else { + return textRange_ == null ? + DbCommons.TextRange.getDefaultInstance() : textRange_; + } + } + /** + *
+       * Only when component is a file. Can be empty for a file if this is an issue global to the file.
+       * 
+ * + * optional .sonarqube.db.commons.TextRange text_range = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + DbCommons.TextRange, DbCommons.TextRange.Builder, DbCommons.TextRangeOrBuilder> + getTextRangeFieldBuilder() { + if (textRangeBuilder_ == null) { + textRangeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + DbCommons.TextRange, DbCommons.TextRange.Builder, DbCommons.TextRangeOrBuilder>( + getTextRange(), + getParentForChildren(), + isClean()); + textRange_ = null; + } + return textRangeBuilder_; + } + + private Object msg_ = ""; + /** + * optional string msg = 3; + * @return Whether the msg field is set. + */ + public boolean hasMsg() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * optional string msg = 3; + * @return The msg. + */ + public String getMsg() { + Object ref = msg_; + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + msg_ = s; + } + return s; + } else { + return (String) ref; + } + } + /** + * optional string msg = 3; + * @return The bytes for msg. + */ + public com.google.protobuf.ByteString + getMsgBytes() { + Object ref = msg_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + msg_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string msg = 3; + * @param value The msg to set. + * @return This builder for chaining. + */ + public Builder setMsg( + String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + msg_ = value; + onChanged(); + return this; + } + /** + * optional string msg = 3; + * @return This builder for chaining. + */ + public Builder clearMsg() { + bitField0_ = (bitField0_ & ~0x00000004); + msg_ = getDefaultInstance().getMsg(); + onChanged(); + return this; + } + /** + * optional string msg = 3; + * @param value The bytes for msg to set. + * @return This builder for chaining. + */ + public Builder setMsgBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + msg_ = value; + onChanged(); + return this; + } + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:sonarqube.db.issues.Location) + } + + // @@protoc_insertion_point(class_scope:sonarqube.db.issues.Location) + private static final Location DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new Location(); + } + + public static Location getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @Deprecated + public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @Override + public Location parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Location(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public Location getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_sonarqube_db_issues_Locations_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_sonarqube_db_issues_Locations_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_sonarqube_db_issues_Flow_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_sonarqube_db_issues_Flow_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_sonarqube_db_issues_Location_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_sonarqube_db_issues_Location_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + String[] descriptorData = { + "\n\017db-issues.proto\022\023sonarqube.db.issues\032\020" + + "db-commons.proto\"i\n\tLocations\0223\n\ntext_ra" + + "nge\030\001 \001(\0132\037.sonarqube.db.commons.TextRan" + + "ge\022\'\n\004flow\030\002 \003(\0132\031.sonarqube.db.issues.F" + + "low\"7\n\004Flow\022/\n\010location\030\001 \003(\0132\035.sonarqub" + + "e.db.issues.Location\"b\n\010Location\022\024\n\014comp" + + "onent_id\030\001 \001(\t\0223\n\ntext_range\030\002 \001(\0132\037.son" + + "arqube.db.commons.TextRange\022\013\n\003msg\030\003 \001(\t" + + "B!\n\035net.educoder.ecsonar.protobufH\001" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + DbCommons.getDescriptor(), + }); + internal_static_sonarqube_db_issues_Locations_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_sonarqube_db_issues_Locations_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_sonarqube_db_issues_Locations_descriptor, + new String[] { "TextRange", "Flow", }); + internal_static_sonarqube_db_issues_Flow_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_sonarqube_db_issues_Flow_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_sonarqube_db_issues_Flow_descriptor, + new String[] { "Location", }); + internal_static_sonarqube_db_issues_Location_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_sonarqube_db_issues_Location_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_sonarqube_db_issues_Location_descriptor, + new String[] { "ComponentId", "TextRange", "Msg", }); + DbCommons.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/main/java/net/educoder/ecsonar/protobuf/DbProjectBranches.java b/src/main/java/net/educoder/ecsonar/protobuf/DbProjectBranches.java new file mode 100644 index 0000000..dc55325 --- /dev/null +++ b/src/main/java/net/educoder/ecsonar/protobuf/DbProjectBranches.java @@ -0,0 +1,1409 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: db-project-branches.proto + +package net.educoder.ecsonar.protobuf; + +public final class DbProjectBranches { + private DbProjectBranches() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface PullRequestDataOrBuilder extends + // @@protoc_insertion_point(interface_extends:sonarqube.db.project_branches.PullRequestData) + com.google.protobuf.MessageOrBuilder { + + /** + * string branch = 1; + * @return The branch. + */ + String getBranch(); + /** + * string branch = 1; + * @return The bytes for branch. + */ + com.google.protobuf.ByteString + getBranchBytes(); + + /** + * string title = 2; + * @return The title. + */ + String getTitle(); + /** + * string title = 2; + * @return The bytes for title. + */ + com.google.protobuf.ByteString + getTitleBytes(); + + /** + * string url = 3; + * @return The url. + */ + String getUrl(); + /** + * string url = 3; + * @return The bytes for url. + */ + com.google.protobuf.ByteString + getUrlBytes(); + + /** + * map<string, string> attributes = 4; + */ + int getAttributesCount(); + /** + * map<string, string> attributes = 4; + */ + boolean containsAttributes( + String key); + /** + * Use {@link #getAttributesMap()} instead. + */ + @Deprecated + java.util.Map + getAttributes(); + /** + * map<string, string> attributes = 4; + */ + java.util.Map + getAttributesMap(); + /** + * map<string, string> attributes = 4; + */ + + /* nullable */ +String getAttributesOrDefault( + String key, + /* nullable */ +String defaultValue); + /** + * map<string, string> attributes = 4; + */ + + String getAttributesOrThrow( + String key); + + /** + * string target = 5; + * @return The target. + */ + String getTarget(); + /** + * string target = 5; + * @return The bytes for target. + */ + com.google.protobuf.ByteString + getTargetBytes(); + } + /** + * Protobuf type {@code sonarqube.db.project_branches.PullRequestData} + */ + public static final class PullRequestData extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:sonarqube.db.project_branches.PullRequestData) + PullRequestDataOrBuilder { + private static final long serialVersionUID = 0L; + // Use PullRequestData.newBuilder() to construct. + private PullRequestData(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PullRequestData() { + branch_ = ""; + title_ = ""; + url_ = ""; + target_ = ""; + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance( + UnusedPrivateParameter unused) { + return new PullRequestData(); + } + + @Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PullRequestData( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + String s = input.readStringRequireUtf8(); + + branch_ = s; + break; + } + case 18: { + String s = input.readStringRequireUtf8(); + + title_ = s; + break; + } + case 26: { + String s = input.readStringRequireUtf8(); + + url_ = s; + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + attributes_ = com.google.protobuf.MapField.newMapField( + AttributesDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + attributes__ = input.readMessage( + AttributesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + attributes_.getMutableMap().put( + attributes__.getKey(), attributes__.getValue()); + break; + } + case 42: { + String s = input.readStringRequireUtf8(); + + target_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return net.educoder.ecsonar.protobuf.DbProjectBranches.internal_static_sonarqube_db_project_branches_PullRequestData_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 4: + return internalGetAttributes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return net.educoder.ecsonar.protobuf.DbProjectBranches.internal_static_sonarqube_db_project_branches_PullRequestData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + PullRequestData.class, Builder.class); + } + + public static final int BRANCH_FIELD_NUMBER = 1; + private volatile Object branch_; + /** + * string branch = 1; + * @return The branch. + */ + @Override + public String getBranch() { + Object ref = branch_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + branch_ = s; + return s; + } + } + /** + * string branch = 1; + * @return The bytes for branch. + */ + @Override + public com.google.protobuf.ByteString + getBranchBytes() { + Object ref = branch_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + branch_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TITLE_FIELD_NUMBER = 2; + private volatile Object title_; + /** + * string title = 2; + * @return The title. + */ + @Override + public String getTitle() { + Object ref = title_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + title_ = s; + return s; + } + } + /** + * string title = 2; + * @return The bytes for title. + */ + @Override + public com.google.protobuf.ByteString + getTitleBytes() { + Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int URL_FIELD_NUMBER = 3; + private volatile Object url_; + /** + * string url = 3; + * @return The url. + */ + @Override + public String getUrl() { + Object ref = url_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + url_ = s; + return s; + } + } + /** + * string url = 3; + * @return The bytes for url. + */ + @Override + public com.google.protobuf.ByteString + getUrlBytes() { + Object ref = url_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ATTRIBUTES_FIELD_NUMBER = 4; + private static final class AttributesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + String, String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + net.educoder.ecsonar.protobuf.DbProjectBranches.internal_static_sonarqube_db_project_branches_PullRequestData_AttributesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + String, String> attributes_; + private com.google.protobuf.MapField + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * map<string, string> attributes = 4; + */ + + @Override + public boolean containsAttributes( + String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetAttributes().getMap().containsKey(key); + } + /** + * Use {@link #getAttributesMap()} instead. + */ + @Override + @Deprecated + public java.util.Map getAttributes() { + return getAttributesMap(); + } + /** + * map<string, string> attributes = 4; + */ + @Override + + public java.util.Map getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * map<string, string> attributes = 4; + */ + @Override + + public String getAttributesOrDefault( + String key, + String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> attributes = 4; + */ + @Override + + public String getAttributesOrThrow( + String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new IllegalArgumentException(); + } + return map.get(key); + } + + public static final int TARGET_FIELD_NUMBER = 5; + private volatile Object target_; + /** + * string target = 5; + * @return The target. + */ + @Override + public String getTarget() { + Object ref = target_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + target_ = s; + return s; + } + } + /** + * string target = 5; + * @return The bytes for target. + */ + @Override + public com.google.protobuf.ByteString + getTargetBytes() { + Object ref = target_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(branch_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, branch_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(title_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, title_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(url_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, url_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetAttributes(), + AttributesDefaultEntryHolder.defaultEntry, + 4); + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, target_); + } + unknownFields.writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(branch_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, branch_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(title_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, title_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(url_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, url_); + } + for (java.util.Map.Entry entry + : internalGetAttributes().getMap().entrySet()) { + com.google.protobuf.MapEntry + attributes__ = AttributesDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, attributes__); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(target_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, target_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof PullRequestData)) { + return super.equals(obj); + } + PullRequestData other = (PullRequestData) obj; + + if (!getBranch() + .equals(other.getBranch())) return false; + if (!getTitle() + .equals(other.getTitle())) return false; + if (!getUrl() + .equals(other.getUrl())) return false; + if (!internalGetAttributes().equals( + other.internalGetAttributes())) return false; + if (!getTarget() + .equals(other.getTarget())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + BRANCH_FIELD_NUMBER; + hash = (53 * hash) + getBranch().hashCode(); + hash = (37 * hash) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + hash = (37 * hash) + URL_FIELD_NUMBER; + hash = (53 * hash) + getUrl().hashCode(); + if (!internalGetAttributes().getMap().isEmpty()) { + hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + internalGetAttributes().hashCode(); + } + hash = (37 * hash) + TARGET_FIELD_NUMBER; + hash = (53 * hash) + getTarget().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static PullRequestData parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static PullRequestData parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static PullRequestData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static PullRequestData parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static PullRequestData parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static PullRequestData parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static PullRequestData parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static PullRequestData parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static PullRequestData parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static PullRequestData parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static PullRequestData parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static PullRequestData parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(PullRequestData prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType( + BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code sonarqube.db.project_branches.PullRequestData} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:sonarqube.db.project_branches.PullRequestData) + PullRequestDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return net.educoder.ecsonar.protobuf.DbProjectBranches.internal_static_sonarqube_db_project_branches_PullRequestData_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 4: + return internalGetAttributes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 4: + return internalGetMutableAttributes(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @Override + protected FieldAccessorTable + internalGetFieldAccessorTable() { + return net.educoder.ecsonar.protobuf.DbProjectBranches.internal_static_sonarqube_db_project_branches_PullRequestData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + PullRequestData.class, Builder.class); + } + + // Construct using net.educoder.ecsonar.protobuf.DbProjectBranches.PullRequestData.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @Override + public Builder clear() { + super.clear(); + branch_ = ""; + + title_ = ""; + + url_ = ""; + + internalGetMutableAttributes().clear(); + target_ = ""; + + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return net.educoder.ecsonar.protobuf.DbProjectBranches.internal_static_sonarqube_db_project_branches_PullRequestData_descriptor; + } + + @Override + public PullRequestData getDefaultInstanceForType() { + return PullRequestData.getDefaultInstance(); + } + + @Override + public PullRequestData build() { + PullRequestData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public PullRequestData buildPartial() { + PullRequestData result = new PullRequestData(this); + int from_bitField0_ = bitField0_; + result.branch_ = branch_; + result.title_ = title_; + result.url_ = url_; + result.attributes_ = internalGetAttributes(); + result.attributes_.makeImmutable(); + result.target_ = target_; + onBuilt(); + return result; + } + + @Override + public Builder clone() { + return super.clone(); + } + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.setField(field, value); + } + @Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return super.setRepeatedField(field, index, value); + } + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.addRepeatedField(field, value); + } + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof PullRequestData) { + return mergeFrom((PullRequestData)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(PullRequestData other) { + if (other == PullRequestData.getDefaultInstance()) return this; + if (!other.getBranch().isEmpty()) { + branch_ = other.branch_; + onChanged(); + } + if (!other.getTitle().isEmpty()) { + title_ = other.title_; + onChanged(); + } + if (!other.getUrl().isEmpty()) { + url_ = other.url_; + onChanged(); + } + internalGetMutableAttributes().mergeFrom( + other.internalGetAttributes()); + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + PullRequestData parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (PullRequestData) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private Object branch_ = ""; + /** + * string branch = 1; + * @return The branch. + */ + public String getBranch() { + Object ref = branch_; + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + branch_ = s; + return s; + } else { + return (String) ref; + } + } + /** + * string branch = 1; + * @return The bytes for branch. + */ + public com.google.protobuf.ByteString + getBranchBytes() { + Object ref = branch_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + branch_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string branch = 1; + * @param value The branch to set. + * @return This builder for chaining. + */ + public Builder setBranch( + String value) { + if (value == null) { + throw new NullPointerException(); + } + + branch_ = value; + onChanged(); + return this; + } + /** + * string branch = 1; + * @return This builder for chaining. + */ + public Builder clearBranch() { + + branch_ = getDefaultInstance().getBranch(); + onChanged(); + return this; + } + /** + * string branch = 1; + * @param value The bytes for branch to set. + * @return This builder for chaining. + */ + public Builder setBranchBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + branch_ = value; + onChanged(); + return this; + } + + private Object title_ = ""; + /** + * string title = 2; + * @return The title. + */ + public String getTitle() { + Object ref = title_; + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + title_ = s; + return s; + } else { + return (String) ref; + } + } + /** + * string title = 2; + * @return The bytes for title. + */ + public com.google.protobuf.ByteString + getTitleBytes() { + Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string title = 2; + * @param value The title to set. + * @return This builder for chaining. + */ + public Builder setTitle( + String value) { + if (value == null) { + throw new NullPointerException(); + } + + title_ = value; + onChanged(); + return this; + } + /** + * string title = 2; + * @return This builder for chaining. + */ + public Builder clearTitle() { + + title_ = getDefaultInstance().getTitle(); + onChanged(); + return this; + } + /** + * string title = 2; + * @param value The bytes for title to set. + * @return This builder for chaining. + */ + public Builder setTitleBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + title_ = value; + onChanged(); + return this; + } + + private Object url_ = ""; + /** + * string url = 3; + * @return The url. + */ + public String getUrl() { + Object ref = url_; + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + url_ = s; + return s; + } else { + return (String) ref; + } + } + /** + * string url = 3; + * @return The bytes for url. + */ + public com.google.protobuf.ByteString + getUrlBytes() { + Object ref = url_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string url = 3; + * @param value The url to set. + * @return This builder for chaining. + */ + public Builder setUrl( + String value) { + if (value == null) { + throw new NullPointerException(); + } + + url_ = value; + onChanged(); + return this; + } + /** + * string url = 3; + * @return This builder for chaining. + */ + public Builder clearUrl() { + + url_ = getDefaultInstance().getUrl(); + onChanged(); + return this; + } + /** + * string url = 3; + * @param value The bytes for url to set. + * @return This builder for chaining. + */ + public Builder setUrlBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + url_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + String, String> attributes_; + private com.google.protobuf.MapField + internalGetAttributes() { + if (attributes_ == null) { + return com.google.protobuf.MapField.emptyMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + return attributes_; + } + private com.google.protobuf.MapField + internalGetMutableAttributes() { + onChanged();; + if (attributes_ == null) { + attributes_ = com.google.protobuf.MapField.newMapField( + AttributesDefaultEntryHolder.defaultEntry); + } + if (!attributes_.isMutable()) { + attributes_ = attributes_.copy(); + } + return attributes_; + } + + public int getAttributesCount() { + return internalGetAttributes().getMap().size(); + } + /** + * map<string, string> attributes = 4; + */ + + @Override + public boolean containsAttributes( + String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetAttributes().getMap().containsKey(key); + } + /** + * Use {@link #getAttributesMap()} instead. + */ + @Override + @Deprecated + public java.util.Map getAttributes() { + return getAttributesMap(); + } + /** + * map<string, string> attributes = 4; + */ + @Override + + public java.util.Map getAttributesMap() { + return internalGetAttributes().getMap(); + } + /** + * map<string, string> attributes = 4; + */ + @Override + + public String getAttributesOrDefault( + String key, + String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetAttributes().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> attributes = 4; + */ + @Override + + public String getAttributesOrThrow( + String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetAttributes().getMap(); + if (!map.containsKey(key)) { + throw new IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearAttributes() { + internalGetMutableAttributes().getMutableMap() + .clear(); + return this; + } + /** + * map<string, string> attributes = 4; + */ + + public Builder removeAttributes( + String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableAttributes().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @Deprecated + public java.util.Map + getMutableAttributes() { + return internalGetMutableAttributes().getMutableMap(); + } + /** + * map<string, string> attributes = 4; + */ + public Builder putAttributes( + String key, + String value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { + throw new NullPointerException("map value"); +} + + internalGetMutableAttributes().getMutableMap() + .put(key, value); + return this; + } + /** + * map<string, string> attributes = 4; + */ + + public Builder putAllAttributes( + java.util.Map values) { + internalGetMutableAttributes().getMutableMap() + .putAll(values); + return this; + } + + private Object target_ = ""; + /** + * string target = 5; + * @return The target. + */ + public String getTarget() { + Object ref = target_; + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + target_ = s; + return s; + } else { + return (String) ref; + } + } + /** + * string target = 5; + * @return The bytes for target. + */ + public com.google.protobuf.ByteString + getTargetBytes() { + Object ref = target_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + target_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string target = 5; + * @param value The target to set. + * @return This builder for chaining. + */ + public Builder setTarget( + String value) { + if (value == null) { + throw new NullPointerException(); + } + + target_ = value; + onChanged(); + return this; + } + /** + * string target = 5; + * @return This builder for chaining. + */ + public Builder clearTarget() { + + target_ = getDefaultInstance().getTarget(); + onChanged(); + return this; + } + /** + * string target = 5; + * @param value The bytes for target to set. + * @return This builder for chaining. + */ + public Builder setTargetBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + target_ = value; + onChanged(); + return this; + } + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:sonarqube.db.project_branches.PullRequestData) + } + + // @@protoc_insertion_point(class_scope:sonarqube.db.project_branches.PullRequestData) + private static final PullRequestData DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new PullRequestData(); + } + + public static PullRequestData getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @Override + public PullRequestData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PullRequestData(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public PullRequestData getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_sonarqube_db_project_branches_PullRequestData_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_sonarqube_db_project_branches_PullRequestData_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_sonarqube_db_project_branches_PullRequestData_AttributesEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_sonarqube_db_project_branches_PullRequestData_AttributesEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + String[] descriptorData = { + "\n\031db-project-branches.proto\022\035sonarqube.d" + + "b.project_branches\"\324\001\n\017PullRequestData\022\016" + + "\n\006branch\030\001 \001(\t\022\r\n\005title\030\002 \001(\t\022\013\n\003url\030\003 \001" + + "(\t\022R\n\nattributes\030\004 \003(\0132>.sonarqube.db.pr" + + "oject_branches.PullRequestData.Attribute" + + "sEntry\022\016\n\006target\030\005 \001(\t\0321\n\017AttributesEntr" + + "y\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001B!\n\035net" + + ".educoder.ecsonar.protobufH\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_sonarqube_db_project_branches_PullRequestData_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_sonarqube_db_project_branches_PullRequestData_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_sonarqube_db_project_branches_PullRequestData_descriptor, + new String[] { "Branch", "Title", "Url", "Attributes", "Target", }); + internal_static_sonarqube_db_project_branches_PullRequestData_AttributesEntry_descriptor = + internal_static_sonarqube_db_project_branches_PullRequestData_descriptor.getNestedTypes().get(0); + internal_static_sonarqube_db_project_branches_PullRequestData_AttributesEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_sonarqube_db_project_branches_PullRequestData_AttributesEntry_descriptor, + new String[] { "Key", "Value", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/main/java/net/educoder/ecsonar/services/QualityInspectService.java b/src/main/java/net/educoder/ecsonar/services/QualityInspectService.java index 7c23be9..0e0f9f3 100644 --- a/src/main/java/net/educoder/ecsonar/services/QualityInspectService.java +++ b/src/main/java/net/educoder/ecsonar/services/QualityInspectService.java @@ -1,21 +1,23 @@ package net.educoder.ecsonar.services; +import com.google.protobuf.InvalidProtocolBufferException; +import net.educoder.ecsonar.dao.*; +import net.educoder.ecsonar.enums.AnalyseTypeEnum; +import net.educoder.ecsonar.enums.DegreeEnum; import net.educoder.ecsonar.exception.BusinessException; -import net.educoder.ecsonar.dao.TaskInfoDao; -import net.educoder.ecsonar.dao.TaskInfoDetailDao; -import net.educoder.ecsonar.model.Metrics; -import net.educoder.ecsonar.model.RollPage; -import net.educoder.ecsonar.model.TaskInfo; -import net.educoder.ecsonar.model.TaskInfoDetail; +import net.educoder.ecsonar.model.*; import net.educoder.ecsonar.model.api.Quality; import net.educoder.ecsonar.model.api.QualityInspect; import net.educoder.ecsonar.model.api.QualityInspectIsCompleted; import net.educoder.ecsonar.model.api.QualityInspectResultData; -import net.educoder.ecsonar.model.vo.QualityInspectUserDataVO; -import net.educoder.ecsonar.model.vo.QualityInspectVO; +import net.educoder.ecsonar.model.dto.*; +import net.educoder.ecsonar.model.vo.*; +import net.educoder.ecsonar.protobuf.DbFileSources; +import net.educoder.ecsonar.protobuf.DbIssues; import net.educoder.ecsonar.task.QualityInspectRunnable; import net.educoder.ecsonar.utils.IdUtils; import net.educoder.ecsonar.utils.SystemUtil; +import net.educoder.ecsonar.utils.html.HtmlSourceDecorator; import org.apache.commons.collections4.CollectionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -54,6 +56,15 @@ public class QualityInspectService { @Autowired private ReportService reportService; + @Autowired + private IssuesDao issuesDao; + + @Autowired + private ProjectDao projectDao; + + @Autowired + private FileSourceDao fileSourceDao; + @Autowired @Qualifier("sonarScannerPool") @@ -63,6 +74,8 @@ public class QualityInspectService { @Qualifier("sonarQueryResultPool") private ExecutorService sonarQueryResultPool; + private static final Logger logger = LoggerFactory.getLogger(QualityInspectService.class); + public QualityInspect qualityInspect(QualityInspectVO qualityInspectVO) { @@ -193,17 +206,167 @@ public class QualityInspectService { // 100 -(阻断 * 10 + 严重 * 5 + 主要* 3 + 次要 * 1)/ 总行数 * 100 Quality bug = resultData.getBug(); - BigDecimal bugScore = BigDecimal.valueOf(100).subtract(BigDecimal.valueOf(bug.getBlocker() * 10 + bug.getCritical() * 5 + bug.getMajor() * 3 + bug.getMinor() * 1).divide(BigDecimal.valueOf(resultData.getTotalRowNumber()),2,RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100))); + BigDecimal bugScore = BigDecimal.valueOf(100).subtract(BigDecimal.valueOf(bug.getBlocker() * 10 + bug.getCritical() * 5 + bug.getMajor() * 3 + bug.getMinor() * 1).divide(BigDecimal.valueOf(resultData.getTotalRowNumber()), 2, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100))); Quality vulnerability = resultData.getVulnerability(); - BigDecimal vulnerabilityScore = BigDecimal.valueOf(100).subtract(BigDecimal.valueOf(vulnerability.getBlocker() * 10 + vulnerability.getCritical() * 5 + vulnerability.getMajor() * 3 + vulnerability.getMinor() * 1).divide(BigDecimal.valueOf(resultData.getTotalRowNumber()),2, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100))); + BigDecimal vulnerabilityScore = BigDecimal.valueOf(100).subtract(BigDecimal.valueOf(vulnerability.getBlocker() * 10 + vulnerability.getCritical() * 5 + vulnerability.getMajor() * 3 + vulnerability.getMinor() * 1).divide(BigDecimal.valueOf(resultData.getTotalRowNumber()), 2, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100))); Quality codeSmall = resultData.getCodeSmall(); - BigDecimal codeSmallScore = BigDecimal.valueOf(100).subtract(BigDecimal.valueOf(codeSmall.getBlocker() * 10 + codeSmall.getCritical() * 5 + codeSmall.getMajor() * 3 + codeSmall.getMinor() * 1).divide(BigDecimal.valueOf(resultData.getTotalRowNumber()),2,RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100))); + BigDecimal codeSmallScore = BigDecimal.valueOf(100).subtract(BigDecimal.valueOf(codeSmall.getBlocker() * 10 + codeSmall.getCritical() * 5 + codeSmall.getMajor() * 3 + codeSmall.getMinor() * 1).divide(BigDecimal.valueOf(resultData.getTotalRowNumber()), 2, RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100))); // 总得分= bugScore * 0.5 + vulnerabilityScore * 0.3 + codeSmallScore * 0.2 BigDecimal score = bugScore.multiply(BigDecimal.valueOf(0.5)).add(vulnerabilityScore.multiply(BigDecimal.valueOf(0.3))).add(codeSmallScore.multiply(BigDecimal.valueOf(0.2))).setScale(2, RoundingMode.HALF_UP); return score; } + + + /** + * 分析详情 + * + * @param analyseDetailVO + * @return + */ + public AnalyseDetailDTO getAnalyseDetail(AnalyseDetailVO analyseDetailVO) { + // 作业id+学号 + String projectName = String.format("%s-%s", analyseDetailVO.getHomeworkId(), analyseDetailVO.getStudentNo()); + + Project project = projectDao.findByName(projectName); + if (project == null) { + throw new BusinessException(-1, String.format("找不到分析记录homeworkId:%s,studentNo:%s", analyseDetailVO.getHomeworkId(), analyseDetailVO.getStudentNo())); + } + + DegreeDTO codeSmall = issuesDao.queryDegree(project.getProject_uuid(), AnalyseTypeEnum.CodeSmell.getType()); + DegreeDTO bug = issuesDao.queryDegree(project.getProject_uuid(), AnalyseTypeEnum.BUG.getType()); + DegreeDTO vulnerability = issuesDao.queryDegree(project.getProject_uuid(), AnalyseTypeEnum.Vulnerability.getType()); + + AnalyseDetailDTO analyseDetail = new AnalyseDetailDTO(); + analyseDetail.setBug(bug == null ? new DegreeDTO() : bug); + analyseDetail.setVulnerability(vulnerability == null ? new DegreeDTO() : vulnerability); + analyseDetail.setCodeSmall(codeSmall == null ? new DegreeDTO() : codeSmall); + return analyseDetail; + } + + + /** + * 风险详情列表 + * + * @param analyseDetailListVO + * @return + */ + public RollPage getAnalyseDetailList(AnalyseDetailListVO analyseDetailListVO) { + + RollPage rollPage = new RollPage(); + + if (analyseDetailListVO.getCurrentPage() <= 0) { + analyseDetailListVO.setCurrentPage(1); + } + + if (analyseDetailListVO.getPageSize() >= 10000) { + analyseDetailListVO.setPageSize(10000); + } + + rollPage.setCurrentPage(analyseDetailListVO.getCurrentPage()); + rollPage.setPageSize(analyseDetailListVO.getPageSize()); + + // 作业id+学号 + String projectName = String.format("%s-%s", analyseDetailListVO.getHomeworkId(), analyseDetailListVO.getStudentNo()); + + Project project = projectDao.findByName(projectName); + if (project == null) { + throw new BusinessException(-1, "找不到分析记录"); + } + + // 分析类型 + AnalyseTypeEnum analyseTypeEnum = AnalyseTypeEnum.getAnalyseTypeEnum(analyseDetailListVO.getType()); + + // 严重程度 + DegreeEnum degreeEnum = DegreeEnum.getDegreeEnum(analyseDetailListVO.getDegree()); + String severity = null; + if (degreeEnum != DegreeEnum.All) { + severity = degreeEnum.getValue(); + } + + Integer pageIssuesCount = issuesDao.getPageIssuesCount(project.getProject_uuid(), analyseTypeEnum.getType(), severity); + rollPage.setRecordSum(pageIssuesCount); + if (pageIssuesCount > 0) { + int start = (analyseDetailListVO.getCurrentPage() - 1) * analyseDetailListVO.getPageSize(); + List pageIssues = issuesDao.getPageIssues(project.getProject_uuid(), analyseTypeEnum.getType(), severity, start, analyseDetailListVO.getPageSize()); + processPageIssues(pageIssues, rollPage); + } else { + rollPage.setRecordList(new ArrayList(0)); + } + + return rollPage; + } + + public String getProblemAnalysis(Integer ruleId) { + Rule rule = projectDao.findRuleById(ruleId); + if (rule != null) { + String example = rule.getDescription().replaceAll("

", "

") + .replaceAll("Noncompliant Code Example", "错误代码示范") + .replaceAll("Compliant Solution", "正确代码示范") + .replaceAll("Exceptions", "异常代码") + .replaceAll("See", "链接"); + return example; + } + return ""; + } + + /** + * 代码详情 + * + * @param codeDetailVO + * @return + */ + public CodeDetailDTO getCodeDetail(CodeDetailVO codeDetailVO) { + + FileSource fileSource = fileSourceDao.findFileSourceFileUuid(codeDetailVO.getUuid()); + + DbFileSources.Data data = fileSource.decodeSourceData(fileSource.getBinaryData()); + List linesList = data.getLinesList(); + + List fileSourceDTOList = new ArrayList<>(linesList.size()); + for (DbFileSources.Line line : linesList) { + FileSourceDTO fileSourceDTO = new FileSourceDTO(); + fileSourceDTO.setRowNumber(line.getLine()); + fileSourceDTO.setCode(HtmlSourceDecorator.getInstance().getDecoratedSourceAsHtml(line.getSource(), line.getHighlighting(), line.getSymbols())); + fileSourceDTOList.add(fileSourceDTO); + } + + CodeDetailDTO codeDetail = new CodeDetailDTO(); + codeDetail.setCodes(fileSourceDTOList); + codeDetail.setExample(getProblemAnalysis(codeDetailVO.getRuleId())); + + + return codeDetail; + } + + + private void processPageIssues(List pageIssues, RollPage rollPage) { + List analyseDetailLists = new ArrayList<>(pageIssues.size()); + + for (Issues pageIssue : pageIssues) { + AnalyseDetailListDTO detailListDTO = new AnalyseDetailListDTO(); + analyseDetailLists.add(detailListDTO); + + detailListDTO.setName(pageIssue.getName()); + detailListDTO.setDescription(pageIssue.getMessage()); + + detailListDTO.setUuid(pageIssue.getUuid()); + detailListDTO.setRuleId(pageIssue.getRuleId()); + detailListDTO.setFilePath(pageIssue.getPath()); + try { + DbIssues.Locations locations = DbIssues.Locations.parseFrom(pageIssue.getLocations()); + detailListDTO.setRowNumber(String.valueOf(locations.getTextRange().getStartLine())); + } catch (InvalidProtocolBufferException e) { + detailListDTO.setRowNumber("0"); + logger.error("Fail to read ISSUES.LOCATIONS [KEE=%s]", e); + } + } + + rollPage.setRecordList(analyseDetailLists); + } + + } diff --git a/src/main/java/net/educoder/ecsonar/utils/html/CharactersReader.java b/src/main/java/net/educoder/ecsonar/utils/html/CharactersReader.java new file mode 100644 index 0000000..7f6ec46 --- /dev/null +++ b/src/main/java/net/educoder/ecsonar/utils/html/CharactersReader.java @@ -0,0 +1,73 @@ +/* + * SonarQube + * Copyright (C) 2009-2019 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package net.educoder.ecsonar.utils.html; + +import java.io.BufferedReader; +import java.io.IOException; +import java.util.ArrayDeque; +import java.util.Deque; + +class CharactersReader { + + static final int END_OF_STREAM = -1; + + private final BufferedReader stringBuffer; + private final Deque openTags; + + private int currentValue; + private int previousValue; + private int currentIndex = -1; + + public CharactersReader(BufferedReader stringBuffer) { + this.stringBuffer = stringBuffer; + this.openTags = new ArrayDeque<>(); + } + + boolean readNextChar() throws IOException { + previousValue = currentValue; + currentValue = stringBuffer.read(); + currentIndex++; + return currentValue != END_OF_STREAM; + } + + int getCurrentValue() { + return currentValue; + } + + int getPreviousValue() { + return previousValue; + } + + int getCurrentIndex() { + return currentIndex; + } + + void registerOpenTag(String textType) { + openTags.push(textType); + } + + void removeLastOpenTag() { + openTags.remove(); + } + + Deque getOpenTags() { + return openTags; + } +} diff --git a/src/main/java/net/educoder/ecsonar/utils/html/DecorationDataHolder.java b/src/main/java/net/educoder/ecsonar/utils/html/DecorationDataHolder.java new file mode 100644 index 0000000..4b12556 --- /dev/null +++ b/src/main/java/net/educoder/ecsonar/utils/html/DecorationDataHolder.java @@ -0,0 +1,133 @@ +/* + * SonarQube + * Copyright (C) 2009-2019 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package net.educoder.ecsonar.utils.html; + + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; + +class DecorationDataHolder { + + private static final String ENTITY_SEPARATOR = ";"; + private static final String FIELD_SEPARATOR = ","; + private static final String SYMBOL_PREFIX = "sym-"; + private static final String HIGHLIGHTABLE = "sym"; + + private List openingTagsEntries; + private int openingTagsIndex; + private List closingTagsOffsets; + private int closingTagsIndex; + + DecorationDataHolder() { + openingTagsEntries = new ArrayList<>(); + closingTagsOffsets = new ArrayList<>(); + } + + void loadSymbolReferences(String symbolsReferences) { + String[] symbols = symbolsReferences.split(ENTITY_SEPARATOR); + for (String symbol : symbols) { + String[] symbolFields = symbol.split(FIELD_SEPARATOR); + int declarationStartOffset = Integer.parseInt(symbolFields[0]); + int declarationEndOffset = Integer.parseInt(symbolFields[1]); + int symbolLength = declarationEndOffset - declarationStartOffset; + String[] symbolOccurrences = Arrays.copyOfRange(symbolFields, 2, symbolFields.length); + loadSymbolOccurrences(declarationStartOffset, symbolLength, symbolOccurrences); + } + } + + void loadLineSymbolReferences(String symbolsReferences) { + String[] symbols = symbolsReferences.split(ENTITY_SEPARATOR); + for (String symbol : symbols) { + String[] symbolFields = symbol.split(FIELD_SEPARATOR); + int startOffset = Integer.parseInt(symbolFields[0]); + int endOffset = Integer.parseInt(symbolFields[1]); + int symbolLength = endOffset - startOffset; + int symbolId = Integer.parseInt(symbolFields[2]); + loadSymbolOccurrences(symbolId, symbolLength, new String[] { Integer.toString(startOffset) }); + } + } + + + void loadSyntaxHighlightingData(String syntaxHighlightingRules) { + String[] rules = syntaxHighlightingRules.split(ENTITY_SEPARATOR); + for (String rule : rules) { + String[] ruleFields = rule.split(FIELD_SEPARATOR); + int startOffset = Integer.parseInt(ruleFields[0]); + int endOffset = Integer.parseInt(ruleFields[1]); + if (startOffset < endOffset) { + insertAndPreserveOrder(new OpeningHtmlTag(startOffset, ruleFields[2]), openingTagsEntries); + insertAndPreserveOrder(endOffset, closingTagsOffsets); + } + } + } + + List getOpeningTagsEntries() { + return openingTagsEntries; + } + + OpeningHtmlTag getCurrentOpeningTagEntry() { + return openingTagsIndex < openingTagsEntries.size() ? openingTagsEntries.get(openingTagsIndex) : null; + } + + void nextOpeningTagEntry() { + openingTagsIndex++; + } + + List getClosingTagsOffsets() { + return closingTagsOffsets; + } + + int getCurrentClosingTagOffset() { + return closingTagsIndex < closingTagsOffsets.size() ? closingTagsOffsets.get(closingTagsIndex) : -1; + } + + void nextClosingTagOffset() { + closingTagsIndex++; + } + + private void loadSymbolOccurrences(int declarationStartOffset, int symbolLength, String[] symbolOccurrences) { + for (String symbolOccurrence : symbolOccurrences) { + int occurrenceStartOffset = Integer.parseInt(symbolOccurrence); + int occurrenceEndOffset = occurrenceStartOffset + symbolLength; + insertAndPreserveOrder(new OpeningHtmlTag(occurrenceStartOffset, SYMBOL_PREFIX + declarationStartOffset + " " + HIGHLIGHTABLE), openingTagsEntries); + insertAndPreserveOrder(occurrenceEndOffset, closingTagsOffsets); + } + } + + private void insertAndPreserveOrder(OpeningHtmlTag newEntry, List openingHtmlTags) { + int insertionIndex = 0; + Iterator tagIterator = openingHtmlTags.iterator(); + while (tagIterator.hasNext() && tagIterator.next().getStartOffset() <= newEntry.getStartOffset()) { + insertionIndex++; + } + openingHtmlTags.add(insertionIndex, newEntry); + } + + private void insertAndPreserveOrder(int newOffset, List orderedOffsets) { + int insertionIndex = 0; + Iterator entriesIterator = orderedOffsets.iterator(); + while (entriesIterator.hasNext() && entriesIterator.next() <= newOffset) { + insertionIndex++; + } + orderedOffsets.add(insertionIndex, newOffset); + } +} diff --git a/src/main/java/net/educoder/ecsonar/utils/html/HtmlSourceDecorator.java b/src/main/java/net/educoder/ecsonar/utils/html/HtmlSourceDecorator.java new file mode 100644 index 0000000..be4a80c --- /dev/null +++ b/src/main/java/net/educoder/ecsonar/utils/html/HtmlSourceDecorator.java @@ -0,0 +1,74 @@ +/* + * SonarQube + * Copyright (C) 2009-2019 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package net.educoder.ecsonar.utils.html; + + +import org.apache.commons.lang3.StringUtils; + +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * 给代码增加样式 + */ +public final class HtmlSourceDecorator { + + private static volatile HtmlSourceDecorator htmlSourceDecorator = null; + + private HtmlSourceDecorator() { + } + + public static HtmlSourceDecorator getInstance() { + if (htmlSourceDecorator == null) { + synchronized (HtmlSourceDecorator.class) { + if (htmlSourceDecorator == null) { + htmlSourceDecorator = new HtmlSourceDecorator(); + } + } + } + return htmlSourceDecorator; + } + + public String getDecoratedSourceAsHtml(@NotNull String sourceLine, @NotNull String highlighting, @NotNull String symbols) { + if (sourceLine == null) { + return null; + } + DecorationDataHolder decorationDataHolder = new DecorationDataHolder(); + if (StringUtils.isNotBlank(highlighting)) { + decorationDataHolder.loadSyntaxHighlightingData(highlighting); + } + if (StringUtils.isNotBlank(symbols)) { + decorationDataHolder.loadLineSymbolReferences(symbols); + } + HtmlTextDecorator textDecorator = new HtmlTextDecorator(); + List decoratedSource = textDecorator.decorateTextWithHtml(sourceLine, decorationDataHolder, 1, 1); + if (decoratedSource == null) { + return null; + } else { + if (decoratedSource.isEmpty()) { + return ""; + } else { + return decoratedSource.get(0); + } + } + } + + +} diff --git a/src/main/java/net/educoder/ecsonar/utils/html/HtmlTextDecorator.java b/src/main/java/net/educoder/ecsonar/utils/html/HtmlTextDecorator.java new file mode 100644 index 0000000..af530c4 --- /dev/null +++ b/src/main/java/net/educoder/ecsonar/utils/html/HtmlTextDecorator.java @@ -0,0 +1,223 @@ +/* + * SonarQube + * Copyright (C) 2009-2019 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package net.educoder.ecsonar.utils.html; + +import com.google.common.io.Closeables; +import lombok.extern.slf4j.Slf4j; +import org.springframework.lang.Nullable; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.StringReader; +import java.util.Collection; +import java.util.List; + +import static com.google.common.collect.Lists.newArrayList; + +@Slf4j +public class HtmlTextDecorator { + + static final char CR_END_OF_LINE = '\r'; + static final char LF_END_OF_LINE = '\n'; + static final char HTML_OPENING = '<'; + static final char HTML_CLOSING = '>'; + static final char AMPERSAND = '&'; + static final String ENCODED_HTML_OPENING = "<"; + static final String ENCODED_HTML_CLOSING = ">"; + static final String ENCODED_AMPERSAND = "&"; + + List decorateTextWithHtml(String text, DecorationDataHolder decorationDataHolder) { + return decorateTextWithHtml(text, decorationDataHolder, null, null); + } + + List decorateTextWithHtml(String text, DecorationDataHolder decorationDataHolder, @Nullable Integer from, @Nullable Integer to) { + + StringBuilder currentHtmlLine = new StringBuilder(); + List decoratedHtmlLines = newArrayList(); + int currentLine = 1; + + BufferedReader stringBuffer = null; + try { + stringBuffer = new BufferedReader(new StringReader(text)); + + CharactersReader charsReader = new CharactersReader(stringBuffer); + + while (charsReader.readNextChar()) { + if (shouldStop(currentLine, to)) { + break; + } + if (shouldStartNewLine(charsReader)) { + if (canAddLine(currentLine, from)) { + decoratedHtmlLines.add(currentHtmlLine.toString()); + } + currentLine++; + currentHtmlLine = new StringBuilder(); + } + addCharToCurrentLine(charsReader, currentHtmlLine, decorationDataHolder); + } + + closeCurrentSyntaxTags(charsReader, currentHtmlLine); + + if (shouldStartNewLine(charsReader)) { + addLine(decoratedHtmlLines, currentHtmlLine.toString(), currentLine, from, to); + currentLine++; + addLine(decoratedHtmlLines, "", currentLine, from, to); + } else if (currentHtmlLine.length() > 0) { + addLine(decoratedHtmlLines, currentHtmlLine.toString(), currentLine, from, to); + } + + } catch (IOException exception) { + String errorMsg = "An exception occurred while highlighting the syntax of one of the project's files"; + log.error(errorMsg); + throw new IllegalStateException(errorMsg, exception); + } finally { + Closeables.closeQuietly(stringBuffer); + } + + return decoratedHtmlLines; + } + + private void addCharToCurrentLine(CharactersReader charsReader, StringBuilder currentHtmlLine, DecorationDataHolder decorationDataHolder) { + if (shouldStartNewLine(charsReader)) { + if (shouldReopenPendingTags(charsReader)) { + reopenCurrentSyntaxTags(charsReader, currentHtmlLine); + } + } + + int numberOfTagsToClose = getNumberOfTagsToClose(charsReader.getCurrentIndex(), decorationDataHolder); + closeCompletedTags(charsReader, numberOfTagsToClose, currentHtmlLine); + + if (shouldClosePendingTags(charsReader)) { + closeCurrentSyntaxTags(charsReader, currentHtmlLine); + } + + Collection tagsToOpen = getTagsToOpen(charsReader.getCurrentIndex(), decorationDataHolder); + openNewTags(charsReader, tagsToOpen, currentHtmlLine); + + if (shouldAppendCharToHtmlOutput(charsReader)) { + char currentChar = (char) charsReader.getCurrentValue(); + currentHtmlLine.append(normalize(currentChar)); + } + } + + private static void addLine(List decoratedHtmlLines, String line, int currentLine, @Nullable Integer from, @Nullable Integer to) { + if (canAddLine(currentLine, from) && !shouldStop(currentLine, to)) { + decoratedHtmlLines.add(line); + } + } + + private static boolean canAddLine(int currentLine, @Nullable Integer from) { + return from == null || currentLine >= from; + } + + private static boolean shouldStop(int currentLine, @Nullable Integer to) { + return to != null && to < currentLine; + } + + private char[] normalize(char currentChar) { + char[] normalizedChars; + if (currentChar == HTML_OPENING) { + normalizedChars = ENCODED_HTML_OPENING.toCharArray(); + } else if (currentChar == HTML_CLOSING) { + normalizedChars = ENCODED_HTML_CLOSING.toCharArray(); + } else if (currentChar == AMPERSAND) { + normalizedChars = ENCODED_AMPERSAND.toCharArray(); + } else { + normalizedChars = new char[] {currentChar}; + } + return normalizedChars; + } + + private boolean shouldAppendCharToHtmlOutput(CharactersReader charsReader) { + return charsReader.getCurrentValue() != CR_END_OF_LINE && charsReader.getCurrentValue() != LF_END_OF_LINE; + } + + private int getNumberOfTagsToClose(int currentIndex, DecorationDataHolder dataHolder) { + int numberOfTagsToClose = 0; + + while (currentIndex == dataHolder.getCurrentClosingTagOffset()) { + numberOfTagsToClose++; + dataHolder.nextClosingTagOffset(); + } + return numberOfTagsToClose; + } + + private Collection getTagsToOpen(int currentIndex, DecorationDataHolder dataHolder) { + Collection tagsToOpen = newArrayList(); + while (dataHolder.getCurrentOpeningTagEntry() != null && currentIndex == dataHolder.getCurrentOpeningTagEntry().getStartOffset()) { + tagsToOpen.add(dataHolder.getCurrentOpeningTagEntry().getCssClass()); + dataHolder.nextOpeningTagEntry(); + } + return tagsToOpen; + } + + private boolean shouldClosePendingTags(CharactersReader charactersReader) { + return charactersReader.getCurrentValue() == CR_END_OF_LINE + || (charactersReader.getCurrentValue() == LF_END_OF_LINE && charactersReader.getPreviousValue() != CR_END_OF_LINE) + || (charactersReader.getCurrentValue() == CharactersReader.END_OF_STREAM && charactersReader.getPreviousValue() != LF_END_OF_LINE); + } + + private boolean shouldReopenPendingTags(CharactersReader charactersReader) { + return (charactersReader.getPreviousValue() == LF_END_OF_LINE && charactersReader.getCurrentValue() != LF_END_OF_LINE) + || (charactersReader.getPreviousValue() == CR_END_OF_LINE && charactersReader.getCurrentValue() != CR_END_OF_LINE + && charactersReader.getCurrentValue() != LF_END_OF_LINE); + } + + private boolean shouldStartNewLine(CharactersReader charactersReader) { + return charactersReader.getPreviousValue() == LF_END_OF_LINE + || (charactersReader.getPreviousValue() == CR_END_OF_LINE && charactersReader.getCurrentValue() != LF_END_OF_LINE); + } + + private void closeCompletedTags(CharactersReader charactersReader, int numberOfTagsToClose, + StringBuilder decoratedText) { + for (int i = 0; i < numberOfTagsToClose; i++) { + injectClosingHtml(decoratedText); + charactersReader.removeLastOpenTag(); + } + } + + private void openNewTags(CharactersReader charactersReader, Collection tagsToOpen, + StringBuilder decoratedText) { + for (String tagToOpen : tagsToOpen) { + injectOpeningHtmlForRule(tagToOpen, decoratedText); + charactersReader.registerOpenTag(tagToOpen); + } + } + + private void closeCurrentSyntaxTags(CharactersReader charactersReader, StringBuilder decoratedText) { + for (int i = 0; i < charactersReader.getOpenTags().size(); i++) { + injectClosingHtml(decoratedText); + } + } + + private void reopenCurrentSyntaxTags(CharactersReader charactersReader, StringBuilder decoratedText) { + for (String tags : charactersReader.getOpenTags()) { + injectOpeningHtmlForRule(tags, decoratedText); + } + } + + private void injectOpeningHtmlForRule(String textType, StringBuilder decoratedText) { + decoratedText.append(""); + } + + private void injectClosingHtml(StringBuilder decoratedText) { + decoratedText.append(""); + } +} diff --git a/src/main/java/net/educoder/ecsonar/utils/html/OpeningHtmlTag.java b/src/main/java/net/educoder/ecsonar/utils/html/OpeningHtmlTag.java new file mode 100644 index 0000000..e41f18d --- /dev/null +++ b/src/main/java/net/educoder/ecsonar/utils/html/OpeningHtmlTag.java @@ -0,0 +1,64 @@ +/* + * SonarQube + * Copyright (C) 2009-2019 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package net.educoder.ecsonar.utils.html; + +class OpeningHtmlTag { + + private final int startOffset; + private final String cssClass; + + OpeningHtmlTag(int startOffset, String cssClass) { + this.startOffset = startOffset; + this.cssClass = cssClass; + } + + int getStartOffset() { + return startOffset; + } + + String getCssClass() { + return cssClass; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return compareTo((OpeningHtmlTag) o); + } + + @Override + public int hashCode() { + int result = startOffset; + result = 31 * result + (cssClass != null ? cssClass.hashCode() : 0); + return result; + } + + private boolean compareTo(OpeningHtmlTag otherTag) { + if (startOffset != otherTag.startOffset) { + return false; + } + return (cssClass != null) ? cssClass.equals(otherTag.cssClass) : (otherTag.cssClass == null); + } +} diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 3609fd7..8a72a76 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -5,10 +5,10 @@ #spring.datasource.driver-class-name=org.postgresql.Driver spring.datasource.initSize=20 -spring.datasource.master.url=jdbc:postgresql://127.0.0.1:5432/sonar7.7 -#spring.datasource.url=jdbc:postgresql://117.50.14.123:5432/sonar -spring.datasource.master.username=root -spring.datasource.master.password=root +#spring.datasource.master.url=jdbc:postgresql://127.0.0.1:5432/sonar7.7 +spring.datasource.master.url=jdbc:postgresql://117.50.14.123:5432/sonar +spring.datasource.master.username=sonar +spring.datasource.master.password=sonar spring.datasource.master.driverClassName=org.postgresql.Driver @@ -57,5 +57,6 @@ skip.checked=true server.port=8081 +mybatis.mapper-locations=classpath:mapper/* -sonar.host=http://localhost:9000 \ No newline at end of file +sonar.host=http://localhost:9000 diff --git a/src/main/resources/mapper/FileSourceMapper.xml b/src/main/resources/mapper/FileSourceMapper.xml new file mode 100644 index 0000000..7784976 --- /dev/null +++ b/src/main/resources/mapper/FileSourceMapper.xml @@ -0,0 +1,19 @@ + + + + + + + + + diff --git a/src/main/resources/mapper/IssuesMapper.xml b/src/main/resources/mapper/IssuesMapper.xml new file mode 100644 index 0000000..b50d13a --- /dev/null +++ b/src/main/resources/mapper/IssuesMapper.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + diff --git a/src/main/resources/mapper/ProjectMapper.xml b/src/main/resources/mapper/ProjectMapper.xml new file mode 100644 index 0000000..5c37ca1 --- /dev/null +++ b/src/main/resources/mapper/ProjectMapper.xml @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/src/main/resources/protobuf/db-commons.proto b/src/main/resources/protobuf/db-commons.proto new file mode 100644 index 0000000..b512f3b --- /dev/null +++ b/src/main/resources/protobuf/db-commons.proto @@ -0,0 +1,41 @@ +// SonarQube, open source software quality management tool. +// Copyright (C) 2008-2016 SonarSource +// mailto:contact AT sonarsource DOT com +// +// SonarQube is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 3 of the License, or (at your option) any later version. +// +// SonarQube is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program; if not, write to the Free Software Foundation, +// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +syntax = "proto2"; + +package sonarqube.db.commons; + +// The java package can be changed without breaking compatibility. +// it impacts only the generated Java code. +option java_package = "net.educoder.quality.protobuf"; +option optimize_for = SPEED; + +// Lines start at 1 and line offsets start at 0 +message TextRange { + // Start line. Should never be absent + optional int32 start_line = 1; + + // End line (inclusive). Absent means it is same as start line + optional int32 end_line = 2; + + // If absent it means range starts at the first offset of start line + optional int32 start_offset = 3; + + // If absent it means range ends at the last offset of end line + optional int32 end_offset = 4; +} diff --git a/src/main/resources/protobuf/db-file-sources.proto b/src/main/resources/protobuf/db-file-sources.proto new file mode 100644 index 0000000..7dfd8e6 --- /dev/null +++ b/src/main/resources/protobuf/db-file-sources.proto @@ -0,0 +1,76 @@ +/* + SonarQube, open source software quality management tool. + Copyright (C) 2008-2016 SonarSource + mailto:contact AT sonarsource DOT com + + SonarQube is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + SonarQube is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +// Structure of db column FILE_SOURCES.BINARY_DATA + +syntax = "proto2"; + +// Package must not be changed for backward-compatibility +// with the DB rows inserted in DB before 5.2 +package org.sonar.server.source.db; + +// The java package can be changed without breaking compatibility. +// it impacts only the generated Java code. +option java_package = "net.educoder.quality.protobuf"; +option optimize_for = SPEED; + +message Line { + optional int32 line = 1; + optional string source = 2; + + // SCM + optional string scm_revision = 3; + optional string scm_author = 4; + optional int64 scm_date = 5; + + // Deprecated fields in 6.2 (has been deprecated when merging coverage into a single metric) + // They are still used to read coverage info from sources that have not be re-analyzed + optional int32 deprecated_ut_line_hits = 6; + optional int32 deprecated_ut_conditions = 7; + optional int32 deprecated_ut_covered_conditions = 8; + optional int32 deprecated_it_line_hits = 9; + optional int32 deprecated_it_conditions = 10; + optional int32 deprecated_it_covered_conditions = 11; + optional int32 deprecated_overall_line_hits = 12; + optional int32 deprecated_overall_conditions = 13; + optional int32 deprecated_overall_covered_conditions = 14; + + optional string highlighting = 15; + optional string symbols = 16; + repeated int32 duplication = 17 [packed = true]; + + // coverage info (since 6.2) + optional int32 line_hits = 18; + optional int32 conditions = 19; + optional int32 covered_conditions = 20; + + optional bool is_new_line = 21; +} + +message Range { + optional int32 startOffset = 1; + optional int32 endOffset = 2; +} + +// TODO should be dropped as it prevents streaming +message Data { + repeated Line lines = 1; +} + diff --git a/src/main/resources/protobuf/db-issues.proto b/src/main/resources/protobuf/db-issues.proto new file mode 100644 index 0000000..a6b44d6 --- /dev/null +++ b/src/main/resources/protobuf/db-issues.proto @@ -0,0 +1,47 @@ +// SonarQube, open source software quality management tool. +// Copyright (C) 2008-2016 SonarSource +// mailto:contact AT sonarsource DOT com +// +// SonarQube is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 3 of the License, or (at your option) any later version. +// +// SonarQube is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program; if not, write to the Free Software Foundation, +// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + +// Structure of table ISSUES + +syntax = "proto2"; + +package sonarqube.db.issues; + +import "db-commons.proto"; + +// The java package can be changed without breaking compatibility. +// it impacts only the generated Java code. +option java_package = "net.educoder.quality.protobuf"; +option optimize_for = SPEED; + +message Locations { + optional sonarqube.db.commons.TextRange text_range = 1; + repeated Flow flow = 2; +} + +message Flow { + repeated Location location = 1; +} + +message Location { + optional string component_id = 1; + // Only when component is a file. Can be empty for a file if this is an issue global to the file. + optional sonarqube.db.commons.TextRange text_range = 2; + optional string msg = 3; +} diff --git a/src/main/resources/protobuf/db-project-branches.proto b/src/main/resources/protobuf/db-project-branches.proto new file mode 100644 index 0000000..3178a05 --- /dev/null +++ b/src/main/resources/protobuf/db-project-branches.proto @@ -0,0 +1,40 @@ +/* + SonarQube, open source software quality management tool. + Copyright (C) 2008-2016 SonarSource + mailto:contact AT sonarsource DOT com + + SonarQube is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + SonarQube is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +// Structure of db column PROJECT_BRANCHES.PULL_REQUEST_DATA + +syntax = "proto3"; + +package sonarqube.db.project_branches; + +// The java package can be changed without breaking compatibility. +// it impacts only the generated Java code. +option java_package = "net.educoder.quality.protobuf"; +option optimize_for = SPEED; + +message PullRequestData { + string branch = 1; + string title = 2; + string url = 3; + + map attributes = 4; + + string target = 5; +}