| 1 | package pro.verron.officestamper.asciidoc; | |
| 2 | ||
| 3 | import pro.verron.officestamper.asciidoc.DocxToAsciiDoc.CommentRecorder.Comment; | |
| 4 | ||
| 5 | import java.math.BigInteger; | |
| 6 | ||
| 7 | /// A builder class for constructing instances of | |
| 8 | /// [Comment]. | |
| 9 | /// | |
| 10 | /// This class allows setting properties step-by-step, providing a | |
| 11 | /// flexible way to construct a complete comment before its creation. | |
| 12 | public class CommentBuilder { | |
| 13 | private BigInteger id; | |
| 14 | private int blockStart; | |
| 15 | private int lineStart; | |
| 16 | private int blockEnd; | |
| 17 | private int lineEnd; | |
| 18 | ||
| 19 | public CommentBuilder(BigInteger id) { | |
| 20 | this.id = id; | |
| 21 | } | |
| 22 | ||
| 23 | /// Creates and returns a new instance of [Comment]. | |
| 24 | /// The instance is constructed with the current state of the builder, | |
| 25 | /// using the configured values for ID, block start, line start, block end, and line end. | |
| 26 | /// | |
| 27 | /// @return a new [Comment] instance with the initialized properties. | |
| 28 | public Comment createComment() { | |
| 29 |
1
1. createComment : replaced return value with null for pro/verron/officestamper/asciidoc/CommentBuilder::createComment → NO_COVERAGE |
return new Comment(id, blockStart, lineStart, blockEnd, lineEnd); |
| 30 | } | |
| 31 | ||
| 32 | /// Retrieves the unique identifier associated with this builder instance. | |
| 33 | /// | |
| 34 | /// @return a [BigInteger] representing the current ID. | |
| 35 | public BigInteger getId() { | |
| 36 |
1
1. getId : replaced return value with null for pro/verron/officestamper/asciidoc/CommentBuilder::getId → NO_COVERAGE |
return this.id; |
| 37 | } | |
| 38 | ||
| 39 | /// Sets the unique identifier for the comment being built. | |
| 40 | /// | |
| 41 | /// @param id the unique identifier for the comment as a [BigInteger] | |
| 42 | /// @return the current instance of [CommentBuilder] for method chaining | |
| 43 | public CommentBuilder setId(BigInteger id) { | |
| 44 | this.id = id; | |
| 45 |
1
1. setId : replaced return value with null for pro/verron/officestamper/asciidoc/CommentBuilder::setId → NO_COVERAGE |
return this; |
| 46 | } | |
| 47 | ||
| 48 | /// Sets the block start position for the comment being built. | |
| 49 | /// | |
| 50 | /// @param blockStart the starting block position as an integer | |
| 51 | /// @return the current instance of [CommentBuilder] for method chaining | |
| 52 | public CommentBuilder setBlockStart(int blockStart) { | |
| 53 | this.blockStart = blockStart; | |
| 54 |
1
1. setBlockStart : replaced return value with null for pro/verron/officestamper/asciidoc/CommentBuilder::setBlockStart → NO_COVERAGE |
return this; |
| 55 | } | |
| 56 | ||
| 57 | /// Sets the starting line position for the comment being built. | |
| 58 | /// | |
| 59 | /// @param lineStart the starting line position as an integer | |
| 60 | /// @return the current instance of [CommentBuilder] for method chaining | |
| 61 | public CommentBuilder setLineStart(int lineStart) { | |
| 62 | this.lineStart = lineStart; | |
| 63 |
1
1. setLineStart : replaced return value with null for pro/verron/officestamper/asciidoc/CommentBuilder::setLineStart → NO_COVERAGE |
return this; |
| 64 | } | |
| 65 | ||
| 66 | /// Sets the block end position for the comment being built. | |
| 67 | /// | |
| 68 | /// @param blockEnd the ending block position as an integer | |
| 69 | /// @return the current instance of [CommentBuilder] for method chaining | |
| 70 | public CommentBuilder setBlockEnd(int blockEnd) { | |
| 71 | this.blockEnd = blockEnd; | |
| 72 |
1
1. setBlockEnd : replaced return value with null for pro/verron/officestamper/asciidoc/CommentBuilder::setBlockEnd → NO_COVERAGE |
return this; |
| 73 | } | |
| 74 | ||
| 75 | /// Sets the ending line position for the comment being built. | |
| 76 | /// | |
| 77 | /// @param lineEnd the ending line position as an integer | |
| 78 | /// @return the current instance of [CommentBuilder] for method chaining | |
| 79 | public CommentBuilder setLineEnd(int lineEnd) { | |
| 80 | this.lineEnd = lineEnd; | |
| 81 |
1
1. setLineEnd : replaced return value with null for pro/verron/officestamper/asciidoc/CommentBuilder::setLineEnd → NO_COVERAGE |
return this; |
| 82 | } | |
| 83 | } | |
Mutations | ||
| 29 |
1.1 |
|
| 36 |
1.1 |
|
| 45 |
1.1 |
|
| 54 |
1.1 |
|
| 63 |
1.1 |
|
| 72 |
1.1 |
|
| 81 |
1.1 |