File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
dsf-bpe-process-api-v2-impl/src/main/java/dev/dsf/bpe/v2/variables
dsf-bpe-process-api-v2/src/main/java/dev/dsf/bpe/v2/variables Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 4
4
import java .util .Collection ;
5
5
import java .util .Collections ;
6
6
import java .util .List ;
7
+ import java .util .Optional ;
7
8
import java .util .stream .Collectors ;
8
9
9
10
import com .fasterxml .jackson .annotation .JsonCreator ;
@@ -72,6 +73,12 @@ public int size()
72
73
return entries .size ();
73
74
}
74
75
76
+ @ Override
77
+ public Optional <Target > getFirst ()
78
+ {
79
+ return entries .isEmpty () ? Optional .empty () : Optional .of (entries .get (0 ));
80
+ }
81
+
75
82
@ Override
76
83
public String toString ()
77
84
{
Original file line number Diff line number Diff line change 2
2
3
3
import java .util .Collection ;
4
4
import java .util .List ;
5
+ import java .util .Optional ;
5
6
6
7
import dev .dsf .bpe .v2 .constants .BpmnExecutionVariables ;
7
8
@@ -54,4 +55,10 @@ public interface Targets
54
55
* @return number of target entries
55
56
*/
56
57
int size ();
58
+
59
+ /**
60
+ * @return {@link Optional} with the first element of the target entries, or {@link Optional#empty()} if
61
+ * {@link Targets#isEmpty()}
62
+ */
63
+ Optional <Target > getFirst ();
57
64
}
You can’t perform that action at this time.
0 commit comments