File tree Expand file tree Collapse file tree 2 files changed +49
-1
lines changed
model/src/main/java/com/basistech/rosette/apimodel Expand file tree Collapse file tree 2 files changed +49
-1
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright 2021 Basis Technology Corp.
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+
17+ package com .basistech .rosette .apimodel ;
18+
19+ import java .util .EnumSet ;
20+
21+ public enum EventsNegationOption {
22+ IGNORE ("Ignore" ),
23+ BOTH ("Both" ),
24+ ONLY_POSITIVE ("Only positive" ),
25+ ONLY_NEGATIVE ("Only negative" );
26+
27+ private final String label ;
28+
29+ EventsNegationOption (String label ) {
30+ this .label = label ;
31+ }
32+
33+ public static EventsNegationOption forValue (String value ) {
34+ for (EventsNegationOption negationOption : EnumSet .allOf (EventsNegationOption .class )) {
35+ if (negationOption .toString ().equalsIgnoreCase (value )) {
36+ return negationOption ;
37+ }
38+ }
39+ throw new IllegalArgumentException ("invalid events negation option: " + value );
40+ }
41+
42+ @ Override
43+ public String toString () {
44+ return label ;
45+ }
46+ }
Original file line number Diff line number Diff line change @@ -34,12 +34,14 @@ public class EventsOptions extends Options {
3434 /**
3535 * Default options
3636 */
37- public static final EventsOptions DEFAULT = EventsOptions .builder ().build ();
37+ public static final EventsOptions DEFAULT = EventsOptions .builder ().negation ( EventsNegationOption . IGNORE ). build ();
3838
3939 /**
4040 * workspaceId to use.
4141 */
4242 String workspaceId ;
4343
4444 EnumMap <LanguageCode , List <String >> plan ;
45+
46+ EventsNegationOption negation ;
4547}
You can’t perform that action at this time.
0 commit comments