MCPcopy Index your code
hub / github.com/google/google-java-format / OpenOp

Class OpenOp

core/src/main/java/com/google/googlejavaformat/OpenOp.java:25–51  ·  view source on GitHub ↗

An OpenOp opens a level. It is an Op in the sequence of Ops generated by OpsBuilder. When the sequence is turned into a Doc by DocBuilder, Input.Toks delimited by OpenOp-CloseOp pairs turn into nested Doc.Levels.

Source from the content-addressed store, hash-verified

23 * Doc.Level}s.
24 */
25public final class OpenOp implements Op {
26 private final Indent plusIndent;
27
28 private OpenOp(Indent plusIndent) {
29 this.plusIndent = plusIndent;
30 }
31
32 /**
33 * Make an ordinary {@code OpenOp}.
34 *
35 * @param plusIndent the indent for breaks at this level
36 * @return the {@code OpenOp}
37 */
38 public static Op make(Indent plusIndent) {
39 return new OpenOp(plusIndent);
40 }
41
42 @Override
43 public void add(DocBuilder builder) {
44 builder.open(plusIndent);
45 }
46
47 @Override
48 public String toString() {
49 return MoreObjects.toStringHelper(this).add("plusIndent", plusIndent).toString();
50 }
51}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…