-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathstreamForInterface.go
708 lines (566 loc) · 20 KB
/
streamForInterface.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
package fpgo
import (
"sort"
)
// Stream
// StreamForInterfaceDef Stream inspired by Collection utils
type StreamForInterfaceDef []interface{}
// FromArrayMaybe FromArrayMaybe New Stream instance from a Maybe array
func (streamSelf *StreamForInterfaceDef) FromArrayMaybe(old []MaybeDef[interface{}]) *StreamForInterfaceDef {
new := make([]interface{}, len(old))
for i, v := range old {
var item interface{} = v
new[i] = item
}
return streamSelf.FromArray(new)
}
// FromArrayString New Stream instance from a string array
func (streamSelf *StreamForInterfaceDef) FromArrayString(old []string) *StreamForInterfaceDef {
new := make([]interface{}, len(old))
for i, v := range old {
var item interface{} = v
new[i] = item
}
return streamSelf.FromArray(new)
}
// FromArrayBool New Stream instance from a bool array
func (streamSelf *StreamForInterfaceDef) FromArrayBool(old []bool) *StreamForInterfaceDef {
new := make([]interface{}, len(old))
for i, v := range old {
var item interface{} = v
new[i] = item
}
return streamSelf.FromArray(new)
}
// FromArrayInt New Stream instance from an int array
func (streamSelf *StreamForInterfaceDef) FromArrayInt(old []int) *StreamForInterfaceDef {
new := make([]interface{}, len(old))
for i, v := range old {
var item interface{} = v
new[i] = item
}
return streamSelf.FromArray(new)
}
// FromArrayByte New Stream instance from an int8 array
func (streamSelf *StreamForInterfaceDef) FromArrayByte(old []byte) *StreamForInterfaceDef {
new := make([]interface{}, len(old))
for i, v := range old {
var item interface{} = v
new[i] = item
}
return streamSelf.FromArray(new)
}
// FromArrayInt8 New Stream instance from an int8 array
func (streamSelf *StreamForInterfaceDef) FromArrayInt8(old []int8) *StreamForInterfaceDef {
new := make([]interface{}, len(old))
for i, v := range old {
var item interface{} = v
new[i] = item
}
return streamSelf.FromArray(new)
}
// FromArrayInt16 New Stream instance from an int16 array
func (streamSelf *StreamForInterfaceDef) FromArrayInt16(old []int16) *StreamForInterfaceDef {
new := make([]interface{}, len(old))
for i, v := range old {
var item interface{} = v
new[i] = item
}
return streamSelf.FromArray(new)
}
// FromArrayInt32 New Stream instance from an int32 array
func (streamSelf *StreamForInterfaceDef) FromArrayInt32(old []int32) *StreamForInterfaceDef {
new := make([]interface{}, len(old))
for i, v := range old {
var item interface{} = v
new[i] = item
}
return streamSelf.FromArray(new)
}
// FromArrayInt64 New Stream instance from an int64 array
func (streamSelf *StreamForInterfaceDef) FromArrayInt64(old []int64) *StreamForInterfaceDef {
new := make([]interface{}, len(old))
for i, v := range old {
var item interface{} = v
new[i] = item
}
return streamSelf.FromArray(new)
}
// FromArrayFloat32 New Stream instance from a float32 array
func (streamSelf *StreamForInterfaceDef) FromArrayFloat32(old []float32) *StreamForInterfaceDef {
new := make([]interface{}, len(old))
for i, v := range old {
var item interface{} = v
new[i] = item
}
return streamSelf.FromArray(new)
}
// FromArrayFloat64 New Stream instance from a float64 array
func (streamSelf *StreamForInterfaceDef) FromArrayFloat64(old []float64) *StreamForInterfaceDef {
new := make([]interface{}, len(old))
for i, v := range old {
var item interface{} = v
new[i] = item
}
return streamSelf.FromArray(new)
}
// From New Stream instance from a interface{} array
func (streamSelf *StreamForInterfaceDef) From(list ...interface{}) *StreamForInterfaceDef {
return StreamForInterface.FromArray(list)
}
// FromArray New Stream instance from an interface{} array
func (streamSelf *StreamForInterfaceDef) FromArray(list []interface{}) *StreamForInterfaceDef {
result := StreamForInterfaceDef(list)
return &result
}
// ToArray Convert Stream to slice
func (streamSelf *StreamForInterfaceDef) ToArray() []interface{} {
return DuplicateSlice(*streamSelf)
}
// Map Map all items of Stream by function
func (streamSelf *StreamForInterfaceDef) Map(fn func(interface{}, int) interface{}) *StreamForInterfaceDef {
result := StreamForInterface.FromArray(MapIndexed(fn, (*streamSelf)...))
return result
}
// Filter Filter items of Stream by function
func (streamSelf *StreamForInterfaceDef) Filter(fn func(interface{}, int) bool) *StreamForInterfaceDef {
result := StreamForInterface.FromArray(Filter(fn, (*streamSelf)...))
return result
}
// Reject Reject items of Stream by function
func (streamSelf *StreamForInterfaceDef) Reject(fn func(interface{}, int) bool) *StreamForInterfaceDef {
result := StreamForInterface.FromArray(Reject(fn, (*streamSelf)...))
return result
}
// FilterNotNil Filter not nil items and return a new Stream instance
func (streamSelf *StreamForInterfaceDef) FilterNotNil() *StreamForInterfaceDef {
return streamSelf.Filter(func(val interface{}, i int) bool {
return Maybe.Just(val).IsPresent()
})
}
// Distinct Filter duplicated items and return a new Stream instance
func (streamSelf *StreamForInterfaceDef) Distinct() *StreamForInterfaceDef {
return StreamForInterface.FromArray(DistinctForInterface(*streamSelf...))
}
// Contains Check the item exists or not in the Stream
func (streamSelf *StreamForInterfaceDef) Contains(input interface{}) bool {
return ExistsForInterface(input, *streamSelf...)
}
// IsSubset returns true or false by checking if stream1 is a subset of stream2
func (streamSelf *StreamForInterfaceDef) IsSubset(input *StreamForInterfaceDef) bool {
if input == nil || input.Len() == 0 {
return false
}
return IsSubsetForInterface(*streamSelf, *input)
}
// IsSuperset returns true or false by checking if stream1 is a superset of stream2
func (streamSelf *StreamForInterfaceDef) IsSuperset(input *StreamForInterfaceDef) bool {
if input == nil || input.Len() == 0 {
return true
}
return IsSupersetForInterface(*streamSelf, *input)
}
// Clone Clone this Stream
func (streamSelf *StreamForInterfaceDef) Clone() *StreamForInterfaceDef {
return StreamForInterface.FromArray(DuplicateSlice(*streamSelf))
}
// Intersection Get the Intersection with this Stream and an another Stream
func (streamSelf *StreamForInterfaceDef) Intersection(input *StreamForInterfaceDef) *StreamForInterfaceDef {
if input == nil || input.Len() == 0 {
return new(StreamForInterfaceDef)
}
result := StreamForInterface.FromArray(IntersectionForInterface(*streamSelf, *input))
return result
}
// Minus Get all of this Stream but not in the given Stream
func (streamSelf *StreamForInterfaceDef) Minus(input *StreamForInterfaceDef) *StreamForInterfaceDef {
if input == nil || input.Len() == 0 {
return streamSelf
}
result := StreamForInterface.FromArray(MinusForInterface(*streamSelf, *input))
return result
}
// RemoveItem Remove items from the Stream
func (streamSelf *StreamForInterfaceDef) RemoveItem(input ...interface{}) *StreamForInterfaceDef {
inputLen := len(input)
if inputLen > 0 {
result := StreamForInterface.FromArray(MinusForInterface(*streamSelf, input))
return result
}
return streamSelf
}
// Append Append an item to Stream
func (streamSelf *StreamForInterfaceDef) Append(item ...interface{}) *StreamForInterfaceDef {
return streamSelf.Concat(item)
}
// Remove Remove an item by its index
func (streamSelf *StreamForInterfaceDef) Remove(index int) *StreamForInterfaceDef {
if index >= 0 && index < streamSelf.Len() {
(*streamSelf) = append((*streamSelf)[:index], (*streamSelf)[index+1:]...)
}
return streamSelf
}
// Len Get length of Stream
func (streamSelf *StreamForInterfaceDef) Len() int {
return len(*streamSelf)
}
// Concat Concat Stream by another slices
func (streamSelf *StreamForInterfaceDef) Concat(slices ...[]interface{}) *StreamForInterfaceDef {
if len(slices) == 0 {
return streamSelf
}
return StreamForInterface.FromArray(Concat(streamSelf.ToArray(), slices...))
}
// Extend Extend Stream by another Stream(s)
func (streamSelf *StreamForInterfaceDef) Extend(streams ...*StreamForInterfaceDef) *StreamForInterfaceDef {
if len(streams) == 0 {
return streamSelf
}
mine := *streamSelf
mineLen := len(mine)
totalLen := mineLen
for _, stream := range streams {
if stream == nil {
continue
}
targetLen := len(*stream)
totalLen += targetLen
}
newOne := make([]interface{}, totalLen)
for i, item := range mine {
newOne[i] = item
}
totalIndex := mineLen
for _, stream := range streams {
if stream == nil {
continue
}
target := *stream
targetLen := len(target)
for j, item := range target {
newOne[totalIndex+j] = item
}
totalIndex += targetLen
}
return StreamForInterface.FromArray(newOne)
}
// Reverse Reverse Stream items
func (streamSelf *StreamForInterfaceDef) Reverse() *StreamForInterfaceDef {
return StreamForInterface.FromArray(Reverse(*streamSelf...))
}
// SortByIndex Sort Stream items by function(index, index) bool
func (streamSelf *StreamForInterfaceDef) SortByIndex(fn func(a, b int) bool) *StreamForInterfaceDef {
// Keep the old value
oldValue := streamSelf.Clone()
// Make the target for sorting (original)
result := *streamSelf
sort.SliceStable(result, fn)
// Replace values back
*streamSelf = *oldValue
// Return the sorted target
return &result
}
// Sort Sort Stream items by Comparator
func (streamSelf *StreamForInterfaceDef) Sort(fn Comparator[interface{}]) *StreamForInterfaceDef {
result := streamSelf.Clone()
Sort(fn, *result)
return result
}
// Get Get an item of Stream by its index
func (streamSelf *StreamForInterfaceDef) Get(i int) interface{} {
return (*streamSelf)[i]
}
// StreamForInterface Stream utils instance
var StreamForInterface StreamForInterfaceDef
// Set
// SetForInterfaceDef Set inspired by Collection utils
type SetForInterfaceDef map[interface{}]interface{}
// SetForInterfaceFrom New Set instance from a interface{} array
func SetForInterfaceFrom(list ...interface{}) *SetForInterfaceDef {
return SetForInterfaceFromArray(list)
}
// SetForInterfaceFromArray New Set instance from a interface{} array
func SetForInterfaceFromArray(list []interface{}) *SetForInterfaceDef {
newOne := SetForInterfaceDef(SliceToMapForInterface(*new(interface{}), list...))
return &newOne
}
// SetForInterfaceFromMap New Set instance from a map[interface{}]R
func SetForInterfaceFromMap(theMap map[interface{}]interface{}) *SetForInterfaceDef {
return SetForInterfaceFromArray(KeysForInterface(theMap))
}
// MapKey Map all keys of Set by function
func (setSelf *SetForInterfaceDef) MapKey(fn TransformerFunctor[interface{}, interface{}]) *SetForInterfaceDef {
result := make(SetForInterfaceDef, len(*setSelf))
for k, v := range *setSelf {
result[fn(k)] = v
}
return &result
}
// MapValue Map all values of Set by function
func (setSelf *SetForInterfaceDef) MapValue(fn TransformerFunctor[interface{}, interface{}]) *SetForInterfaceDef {
result := make(SetForInterfaceDef, len(*setSelf))
for k, v := range *setSelf {
result[k] = fn(v)
}
return &result
}
// ContainsKey Check the key exists or not in the Set
func (setSelf *SetForInterfaceDef) ContainsKey(input interface{}) bool {
_, ok := (*setSelf)[input]
return ok
}
// ContainsValue Check the value exists or not in the Set
func (setSelf *SetForInterfaceDef) ContainsValue(input interface{}) bool {
for _, v := range *setSelf {
if v == input {
return true
}
}
return false
}
// IsSubsetByKey returns true or false by checking if set1 is a subset of set2
func (setSelf *SetForInterfaceDef) IsSubsetByKey(input *SetForInterfaceDef) bool {
return IsSubsetMapByKeyForInterface(*setSelf, *input)
}
// IsSupersetByKey returns true or false by checking if set1 is a superset of set2
func (setSelf *SetForInterfaceDef) IsSupersetByKey(input *SetForInterfaceDef) bool {
return IsSupersetMapByKeyForInterface(*setSelf, *input)
}
// Add Add items into the Set
func (setSelf *SetForInterfaceDef) Add(input ...interface{}) *SetForInterfaceDef {
inputLen := len(input)
if inputLen > 0 {
result := setSelf.Clone()
for _, v := range input {
if _, ok := (*result)[v]; ok {
continue
}
(*result)[v] = true
}
return result
}
return setSelf
}
// RemoveKeys Remove keys from the Set
func (setSelf *SetForInterfaceDef) RemoveKeys(input ...interface{}) *SetForInterfaceDef {
inputLen := len(input)
if inputLen > 0 {
result := setSelf.Clone()
for _, v := range input {
delete(*result, v)
}
return result
}
return setSelf
}
// RemoveValues Remove values from the Set
func (setSelf *SetForInterfaceDef) RemoveValues(input ...interface{}) *SetForInterfaceDef {
inputLen := len(input)
if inputLen > 0 {
result := setSelf.Clone()
valueMap := SliceToMapForInterface(0, input...)
for k, v := range *setSelf {
if _, ok := valueMap[v]; ok {
delete(*result, k)
}
}
return result
}
return setSelf
}
// Get Get items from the Set
func (setSelf *SetForInterfaceDef) Get(key interface{}) interface{} {
return (*setSelf)[key]
}
// Set Set items to the Set
func (setSelf *SetForInterfaceDef) Set(key interface{}, value interface{}) {
(*setSelf)[key] = value
// return setSelf
}
// Clone Clone this Set
func (setSelf *SetForInterfaceDef) Clone() *SetForInterfaceDef {
result := SetForInterfaceDef(DuplicateMapForInterface(*setSelf))
return &result
}
// Union Union an another Set object
func (setSelf *SetForInterfaceDef) Union(input *SetForInterfaceDef) *SetForInterfaceDef {
if input == nil || input.Size() == 0 {
return setSelf
}
result := SetForInterfaceDef(MergeForInterface(*setSelf, *input))
return &result
}
// Intersection Get the Intersection with this Set and an another Set
func (setSelf *SetForInterfaceDef) Intersection(input *SetForInterfaceDef) *SetForInterfaceDef {
if input == nil || input.Size() == 0 {
return new(SetForInterfaceDef)
}
result := SetForInterfaceDef(IntersectionMapByKeyForInterface(*setSelf, *input))
return &result
}
// Minus Get all of this Set but not in the given Set
func (setSelf *SetForInterfaceDef) Minus(input *SetForInterfaceDef) *SetForInterfaceDef {
if input == nil || input.Size() == 0 {
return setSelf
}
result := setSelf.Clone()
for k := range *result {
_, exists := (*input)[k]
if exists {
delete(*result, k)
}
}
return result
}
// Size Get size
func (setSelf *SetForInterfaceDef) Size() int {
return len(*setSelf)
}
// Keys Convert Set to slice
func (setSelf *SetForInterfaceDef) Keys() []interface{} {
return KeysForInterface(*setSelf)
}
// Values Convert Set to slice
func (setSelf *SetForInterfaceDef) Values() []interface{} {
return ValuesForInterface(*setSelf)
}
// Set Set utils instance
var Set SetForInterfaceDef
// StreamSetForInterface
// StreamSetForInterfaceDef Set inspired by Collection utils
type StreamSetForInterfaceDef struct {
SetForInterfaceDef
}
// NewStreamSetForInterface New StreamSetForInterface instance
func NewStreamSetForInterface() *StreamSetForInterfaceDef {
return &StreamSetForInterfaceDef{
SetForInterfaceDef: SetForInterfaceDef{},
}
}
// StreamSetForInterfaceFrom New StreamSetForInterface instance from a T array
func StreamSetForInterfaceFrom(list ...interface{}) *StreamSetForInterfaceDef {
return StreamSetForInterfaceFromArray(list)
}
// StreamSetForInterfaceFromArray New StreamSetForInterface instance from a T array
func StreamSetForInterfaceFromArray(list []interface{}) *StreamSetForInterfaceDef {
newOne := NewStreamSetForInterface()
for _, v := range list {
newOne.SetForInterfaceDef[v] = new(StreamForInterfaceDef)
}
return newOne
}
// StreamSetForInterfaceFromMap New StreamSetForInterface instance from a map[T]R
func StreamSetForInterfaceFromMap(theMap map[interface{}]*StreamForInterfaceDef) *StreamSetForInterfaceDef {
resultMap := make(map[interface{}]interface{}, len(theMap))
for k, v := range theMap {
resultMap[k] = v
}
result := StreamSetForInterfaceDef{
SetForInterfaceDef: SetForInterfaceDef(resultMap),
}
return &result
}
// StreamSetFromInterface New StreamSetForInterface instance from an array
func StreamSetFromInterface(list ...interface{}) *StreamSetForInterfaceDef {
return StreamSetForInterfaceFromArray(list)
}
// StreamSetFromArrayInterface New StreamSetForInterface instance from an array
func StreamSetFromArrayInterface(list []interface{}) *StreamSetForInterfaceDef {
return StreamSetForInterfaceFromArray(list)
}
// Clone Clone this StreamSetForInterface
func (streamSetSelf *StreamSetForInterfaceDef) Clone() *StreamSetForInterfaceDef {
result := &StreamSetForInterfaceDef{SetForInterfaceDef: SetForInterfaceDef(DuplicateMapForInterface(streamSetSelf.SetForInterfaceDef))}
for k, v := range result.SetForInterfaceDef {
if v != nil {
v = v.(*StreamForInterfaceDef).Clone()
(result.SetForInterfaceDef)[k] = v
}
}
return result
}
// Union Union an another StreamSetForInterface object
func (streamSetSelf *StreamSetForInterfaceDef) Union(input *StreamSetForInterfaceDef) *StreamSetForInterfaceDef {
if input == nil || input.Size() == 0 {
return streamSetSelf
}
result := &StreamSetForInterfaceDef{SetForInterfaceDef: SetForInterfaceDef(MergeForInterface(streamSetSelf.SetForInterfaceDef, input.SetForInterfaceDef))}
for k, v := range streamSetSelf.SetForInterfaceDef {
v2, ok := (input.SetForInterfaceDef)[k]
if ok && v2 != nil && v2.(*StreamForInterfaceDef).Len() > 0 {
if v == nil {
v = new(StreamForInterfaceDef)
}
v = v.(*StreamForInterfaceDef).Extend(v2.(*StreamForInterfaceDef))
(result.SetForInterfaceDef)[k] = v
}
}
return result
}
// Intersection Get the Intersection with this StreamSetForInterface and an another StreamSetForInterface
func (streamSetSelf *StreamSetForInterfaceDef) Intersection(input *StreamSetForInterfaceDef) *StreamSetForInterfaceDef {
if input == nil || input.Size() == 0 {
return NewStreamSetForInterface()
}
result := &StreamSetForInterfaceDef{SetForInterfaceDef: SetForInterfaceDef(IntersectionMapByKeyForInterface(streamSetSelf.SetForInterfaceDef, input.SetForInterfaceDef))}
for k, v := range result.SetForInterfaceDef {
v2, ok := (input.SetForInterfaceDef)[k]
if ok && v2 != nil && v2.(*StreamForInterfaceDef).Len() > 0 {
if v == nil {
v = new(StreamForInterfaceDef)
}
v = v.(*StreamForInterfaceDef).Intersection(v2.(*StreamForInterfaceDef))
(result.SetForInterfaceDef)[k] = v
}
}
return result
}
// MinusStreams Minus the Stream values by their keys(keys will not be changed but Stream values will)
func (streamSetSelf *StreamSetForInterfaceDef) MinusStreams(input *StreamSetForInterfaceDef) *StreamSetForInterfaceDef {
if input == nil || input.Size() == 0 {
return NewStreamSetForInterface()
}
result := streamSetSelf.Clone()
for k, v := range result.SetForInterfaceDef {
v2, ok := (input.SetForInterfaceDef)[k]
if ok && v2 != nil && v2.(*StreamForInterfaceDef).Len() > 0 {
if v == nil {
v = new(StreamForInterfaceDef)
}
v = v.(*StreamForInterfaceDef).Minus(v2.(*StreamForInterfaceDef))
(result.SetForInterfaceDef)[k] = v
}
}
return result
}
/**
TODO DUPLICATED ZONE (temporarily)
BEGIN
**/
// IsSubsetByKey TODO NOTE !!Duplicated!! returns true or false by checking if set1 is a subset of set2
func (streamSetSelf *StreamSetForInterfaceDef) IsSubsetByKey(input *StreamSetForInterfaceDef) bool {
if input == nil || input.Size() == 0 {
return false
}
return streamSetSelf.SetForInterfaceDef.IsSubsetByKey(&input.SetForInterfaceDef)
}
// IsSupersetByKey TODO NOTE !!Duplicated!! returns true or false by checking if set1 is a superset of set2
func (streamSetSelf *StreamSetForInterfaceDef) IsSupersetByKey(input *StreamSetForInterfaceDef) bool {
if input == nil || input.Size() == 0 {
return true
}
return streamSetSelf.SetForInterfaceDef.IsSupersetByKey(&input.SetForInterfaceDef)
}
// Minus TODO NOTE !!Duplicated!! Get all of this StreamSetForInterface but not in the given StreamSetForInterface
func (streamSetSelf *StreamSetForInterfaceDef) Minus(input *StreamSetForInterfaceDef) *StreamSetForInterfaceDef {
if input == nil || input.Size() == 0 {
return NewStreamSetForInterface()
}
return &StreamSetForInterfaceDef{SetForInterfaceDef: *streamSetSelf.SetForInterfaceDef.Minus(&input.SetForInterfaceDef)}
}
/**
TODO DUPLICATED ZONE (temporarily)
END
**/
// StreamSetForInterface StreamSetForInterface utils instance
var StreamSetForInterface StreamSetForInterfaceDef