@@ -27,6 +27,7 @@ public static final class NodeCategory {
2727 public static final NodeCategory EVENT = new NodeCategory ("event" , "Event" , 0xFFFF5555 , 100 );
2828 public static final NodeCategory ACTION = new NodeCategory ("action" , "Action" , 0xFF5555FF , 200 );
2929 public static final NodeCategory LOGIC = new NodeCategory ("logic" , "Logic" , 0xFFFF55FF , 300 );
30+ public static final NodeCategory NETWORK = new NodeCategory ("network" , "Network" , 0xFF4F8CFF , 350 );
3031 public static final NodeCategory DATA = new NodeCategory ("data" , "Data" , 0xFF55FFFF , 400 );
3132 public static final NodeCategory VARIABLE = new NodeCategory ("variable" , "Variable" , 0xFFFFFF55 , 500 );
3233 public static final NodeCategory FUNCTION = new NodeCategory ("function" , "Function" , 0xFFFFAA55 , 600 );
@@ -358,20 +359,31 @@ public static class PinDefinition {
358359 private final PinConstraints constraints ;
359360 private final Map <String , String > visibleWhen ;
360361 private final String description ;
362+ private final boolean optional ;
361363
362364 public PinDefinition (String name , PinType type , PinDirection direction , FlowDataType dataType ) {
363- this (name , type , direction , dataType , null , null , null , null , null , null , null );
365+ this (name , type , direction , dataType , null , null , null , null , null , null , null , false );
366+ }
367+
368+ public PinDefinition (String name , PinType type , PinDirection direction , FlowDataType dataType , boolean optional ) {
369+ this (name , type , direction , dataType , null , null , null , null , null , null , null , optional );
364370 }
365371
366372 public PinDefinition (String name , PinType type , PinDirection direction , FlowDataType dataType ,
367373 WidgetType widgetType , List <String > options , String defaultValue ,
368374 PinConstraints constraints , Map <String , String > visibleWhen , String description ) {
369- this (name , type , direction , dataType , widgetType , options , null , defaultValue , constraints , visibleWhen , description );
375+ this (name , type , direction , dataType , widgetType , options , null , defaultValue , constraints , visibleWhen , description , false );
370376 }
371377
372378 public PinDefinition (String name , PinType type , PinDirection direction , FlowDataType dataType ,
373379 WidgetType widgetType , List <String > options , String optionsSource , String defaultValue ,
374380 PinConstraints constraints , Map <String , String > visibleWhen , String description ) {
381+ this (name , type , direction , dataType , widgetType , options , optionsSource , defaultValue , constraints , visibleWhen , description , false );
382+ }
383+
384+ public PinDefinition (String name , PinType type , PinDirection direction , FlowDataType dataType ,
385+ WidgetType widgetType , List <String > options , String optionsSource , String defaultValue ,
386+ PinConstraints constraints , Map <String , String > visibleWhen , String description , boolean optional ) {
375387 this .name = name ;
376388 this .type = type ;
377389 this .direction = direction ;
@@ -383,6 +395,7 @@ public PinDefinition(String name, PinType type, PinDirection direction, FlowData
383395 this .constraints = constraints ;
384396 this .visibleWhen = visibleWhen != null ? visibleWhen : Collections .emptyMap ();
385397 this .description = description ;
398+ this .optional = optional ;
386399 }
387400
388401 public String getName () {
@@ -428,6 +441,10 @@ public Map<String, String> getVisibleWhen() {
428441 public String getDescription () {
429442 return description ;
430443 }
444+
445+ public boolean isOptional () {
446+ return optional ;
447+ }
431448 }
432449
433450 public static class Builder {
@@ -641,6 +658,7 @@ public static class PinBuilder {
641658 private PinConstraints constraints ;
642659 private Map <String , String > visibleWhen ;
643660 private String description ;
661+ private boolean optional ;
644662
645663 public PinBuilder (String name , PinType type , PinDirection direction , FlowDataType dataType ) {
646664 this .name = name ;
@@ -695,8 +713,13 @@ public PinBuilder description(String description) {
695713 return this ;
696714 }
697715
716+ public PinBuilder optional (boolean optional ) {
717+ this .optional = optional ;
718+ return this ;
719+ }
720+
698721 public PinDefinition build () {
699- return new PinDefinition (name , type , direction , dataType , widgetType , options , optionsSource , defaultValue , constraints , visibleWhen , description );
722+ return new PinDefinition (name , type , direction , dataType , widgetType , options , optionsSource , defaultValue , constraints , visibleWhen , description , optional );
700723 }
701724 }
702725}
0 commit comments