• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

temporalio / sdk-java / #433

20 Nov 2026 11:28PM UTC coverage: 71.886% (+0.05%) from 71.837%
#433

push

github

web-flow
Report storage driver types in worker heartbeats (#3230)

8791 of 14383 branches covered (61.12%)

Branch coverage included in aggregate %.

9 of 9 new or added lines in 1 file covered. (100.0%)

146 existing lines in 21 files now uncovered.

34692 of 46106 relevant lines covered (75.24%)

0.75 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

59.68
/temporal-sdk/src/main/java/io/temporal/workflow/CancelExternalWorkflowOptions.java
1
package io.temporal.workflow;
2

3
import io.temporal.common.Experimental;
4
import java.util.*;
5
import javax.annotation.Nullable;
6

7
/** Options for {@link ExternalWorkflowStub#cancelWithOptions(CancelExternalWorkflowOptions)}. */
8
public final class CancelExternalWorkflowOptions {
9

10
  public static CancelExternalWorkflowOptions.Builder newBuilder() {
11
    return new CancelExternalWorkflowOptions.Builder();
1 ✔
12
  }
13

14
  public static CancelExternalWorkflowOptions.Builder newBuilder(
15
      CancelExternalWorkflowOptions options) {
16
    return new CancelExternalWorkflowOptions.Builder(options);
×
17
  }
18

19
  public static CancelExternalWorkflowOptions getDefaultInstance() {
20
    return DEFAULT_INSTANCE;
1 ✔
21
  }
22

23
  private static final CancelExternalWorkflowOptions DEFAULT_INSTANCE;
24

25
  static {
26
    DEFAULT_INSTANCE = CancelExternalWorkflowOptions.newBuilder().build();
1 ✔
27
  }
1 ✔
28

29
  public static final class Builder {
30
    private @Nullable String reason;
31
    private List<EventGroup> eventGroups;
32

33
    private Builder() {}
34

35
    private Builder(CancelExternalWorkflowOptions options) {
1 ✔
36
      if (options == null) {
1 !
37
        return;
×
38
      }
39
      this.reason = options.reason;
1 ✔
40
      if (!options.eventGroups.isEmpty()) {
1 !
41
        this.eventGroups = new ArrayList<>(options.eventGroups);
×
42
      }
43
    }
1 ✔
44

45
    /**
46
     * Reason recorded on the cancellation request.
47
     *
48
     * <p>Default is none.
49
     */
50
    public Builder setReason(@Nullable String reason) {
51
      this.reason = reason;
1 ✔
52
      return this;
1 ✔
53
    }
54

55
    /**
56
     * Event Groups to associate with the cancellation request command, in addition to those in
57
     * scope. Calls accumulate.
58
     *
59
     * @see EventGroup
60
     */
61
    @Experimental
62
    public Builder addEventGroups(EventGroup... eventGroups) {
63
      if (eventGroups.length == 0) return this;
1 !
64
      if (this.eventGroups == null) {
1 !
65
        this.eventGroups = new ArrayList<>(eventGroups.length);
1 ✔
66
      }
67
      for (EventGroup group : eventGroups) {
1 ✔
68
        this.eventGroups.add(Objects.requireNonNull(group, "eventGroups"));
1 ✔
69
      }
70
      return this;
1 ✔
71
    }
72

73
    /**
74
     * Associates the given Event Groups, in addition to any already added. Calls accumulate.
75
     *
76
     * @see EventGroup
77
     */
78
    @Experimental
79
    public Builder addEventGroups(List<EventGroup> eventGroups) {
UNCOV
80
      return addEventGroups(eventGroups.toArray(new EventGroup[0]));
×
81
    }
82

83
    public CancelExternalWorkflowOptions build() {
84
      return new CancelExternalWorkflowOptions(reason, eventGroups);
1 ✔
85
    }
86
  }
87

88
  private final @Nullable String reason;
89
  private final List<EventGroup> eventGroups;
90

91
  private CancelExternalWorkflowOptions(@Nullable String reason, List<EventGroup> eventGroups) {
1 ✔
92
    this.reason = reason;
1 ✔
93
    this.eventGroups =
1 ✔
94
        eventGroups == null || eventGroups.isEmpty()
1 !
95
            ? Collections.emptyList()
1 ✔
96
            : Collections.unmodifiableList(new ArrayList<>(eventGroups));
1 ✔
97
  }
1 ✔
98

99
  @Nullable
100
  public String getReason() {
101
    return reason;
1 ✔
102
  }
103

104
  @Experimental
105
  public List<EventGroup> getEventGroups() {
106
    return eventGroups;
1 ✔
107
  }
108

109
  public Builder toBuilder() {
110
    return new Builder(this);
1 ✔
111
  }
112

113
  @Override
114
  public String toString() {
UNCOV
115
    return "CancelExternalWorkflowOptions{"
×
116
        + "reason='"
117
        + reason
118
        + '\''
119
        + ", eventGroups="
120
        + eventGroups
121
        + '}';
122
  }
123

124
  @Override
125
  public boolean equals(Object o) {
126
    if (this == o) return true;
×
127
    if (o == null || getClass() != o.getClass()) return false;
×
128
    CancelExternalWorkflowOptions that = (CancelExternalWorkflowOptions) o;
×
UNCOV
129
    return Objects.equals(reason, that.reason) && Objects.equals(eventGroups, that.eventGroups);
×
130
  }
131

132
  @Override
133
  public int hashCode() {
UNCOV
134
    return Objects.hash(reason, eventGroups);
×
135
  }
136
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc