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

devonfw / IDEasy / 26751383739

01 Jun 2026 11:12AM UTC coverage: 71.118% (+0.02%) from 71.094%
26751383739

Pull #1954

github

web-flow
Merge 7c8cbd8ba into 63240371f
Pull Request #1954: #1946: spyder commandlet

4510 of 7022 branches covered (64.23%)

Branch coverage included in aggregate %.

11690 of 15757 relevant lines covered (74.19%)

3.14 hits per line

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

98.17
cli/src/main/java/com/devonfw/tools/ide/common/Tag.java
1
package com.devonfw.tools.ide.common;
2

3
import java.util.Collection;
4
import java.util.Collections;
5
import java.util.HashMap;
6
import java.util.HashSet;
7
import java.util.Locale;
8
import java.util.Map;
9
import java.util.Objects;
10
import java.util.Set;
11

12
/**
13
 * A {@link Tag} represents a classifier or category. A tool and plugin can be associated with {@link Tag}s allowing end users to find them.
14
 */
15
public final class Tag {
16

17
  private static final Tag[] NO_TAGS = new Tag[0];
3✔
18

19
  private static final Map<String, Tag> TAG_MAP = new HashMap<>(128);
5✔
20

21
  private static final Collection<Tag> ALL_TAGS = Collections.unmodifiableCollection(TAG_MAP.values());
4✔
22

23
  /** The root {@link Tag}. */
24
  public static final Tag ROOT = new Tag();
4✔
25

26
  static {
27
    TAG_MAP.put(ROOT.id, ROOT);
6✔
28
  }
29

30
  /** {@link #getParent() Parent} for miscellaneous (undefined) tags. */
31
  public static final Tag MISC = create("miscellaneous", ROOT, true, "misc");
6✔
32

33
  /** {@link #getParent() Parent} for programming-languages. */
34
  public static final Tag LANGUAGE = create("language", ROOT, true, "programming");
6✔
35

36
  /** {@link Tag} for JVM (Java Virtual Machine). */
37
  public static final Tag JVM = create("java-virtual-machine", LANGUAGE, false, "jvm");
6✔
38

39
  /** {@link Tag} for Java. */
40
  public static final Tag JAVA = create("java", JVM);
4✔
41

42
  /** {@link Tag} for Go. */
43
  public static final Tag GO = create("go", LANGUAGE);
4✔
44

45
  /** {@link Tag} for Kotlin. */
46
  public static final Tag KOTLIN = create("kotlin", JVM);
4✔
47

48
  /** {@link Tag} for Scala. */
49
  public static final Tag SCALA = create("scala", JVM);
4✔
50

51
  /** {@link Tag} for DotNet (.NET). */
52
  public static final Tag DOTNET = create("dotnet", LANGUAGE, false, "net");
6✔
53

54
  /** {@link Tag} for C#. */
55
  public static final Tag CS = create("c#", DOTNET, false, "cs", "csharp");
15✔
56

57
  /** {@link Tag} for C. */
58
  public static final Tag C = create("c", LANGUAGE);
4✔
59

60
  /** {@link Tag} for Rust. */
61
  public static final Tag RUST = create("rust", LANGUAGE, false, "rs");
6✔
62

63
  /** {@link Tag} for C++. */
64
  public static final Tag CPP = create("c++", LANGUAGE, false, "cpp");
6✔
65

66
  /** {@link Tag} for Python. */
67
  public static final Tag PYTHON = create("python", LANGUAGE);
4✔
68

69
  /** {@link Tag} for Ruby. */
70
  public static final Tag RUBY = create("ruby", LANGUAGE);
4✔
71

72
  /** {@link Tag} for Perl. */
73
  public static final Tag PERL = create("perl", LANGUAGE);
4✔
74

75
  /** {@link Tag} for Shell scripting. */
76
  public static final Tag SHELL = create("shell", JVM, false, "script");
6✔
77

78
  /** {@link Tag} for Bash. */
79
  public static final Tag BASH = create("bash", SHELL, false, "terminal");
6✔
80

81
  /** {@link Tag} for TypeScript. */
82
  public static final Tag JAVA_SCRIPT = create("javascript", LANGUAGE, false, "js");
6✔
83

84
  /** {@link Tag} for TypeScript. */
85
  public static final Tag TYPE_SCRIPT = create("typescript", JAVA_SCRIPT, false, "ts");
6✔
86

87
  /** {@link #getParent() Parent} for programming-languages. */
88
  public static final Tag IDE = create("ide", ROOT);
4✔
89

90
  /** {@link Tag} for Eclipse. */
91
  public static final Tag ECLIPSE = create("eclipse", IDE);
4✔
92

93
  /** {@link Tag} for IDEA (JetBrains IDE Platform). */
94
  public static final Tag IDEA = create("idea", IDE);
4✔
95

96
  /** {@link Tag} for IntelliJ. */
97
  public static final Tag INTELLIJ = create("intellij", IDEA);
4✔
98

99
  /** {@link Tag} for Android-Studio. */
100
  public static final Tag ANDROID_STUDIO = create("android-studio", IDEA);
4✔
101

102
  /** {@link Tag} for Pycharm. */
103
  public static final Tag PYCHARM = create("pycharm", IDEA);
4✔
104

105
  /** {@link Tag} for VS-Code. */
106
  public static final Tag VS_CODE = create("vscode", IDE, false, "visualstudiocode");
6✔
107

108
  /** {@link Tag} for Spyder. */
109
  public static final Tag SPYDER = create("spyder", IDE, false, new String[0], PYTHON);
13✔
110

111
  /** {@link Tag} for (code-)generators (including template-engines, etc.). */
112
  public static final Tag GENERATOR = create("generator", ROOT);
4✔
113

114
  /** {@link #getParent() Parent} for frameworks. */
115
  public static final Tag FRAMEWORK = create("framework", ROOT, true);
5✔
116

117
  /** {@link Tag} for Spring(framework). */
118
  public static final Tag SPRING = create("spring", FRAMEWORK, false, new String[] { "springframework", "springboot" },
21✔
119
      JAVA);
120

121
  /** {@link Tag} for Quarkus. */
122
  public static final Tag QUARKUS = create("quarkus", FRAMEWORK, false, null, JAVA);
12✔
123

124
  /** {@link Tag} for Micronaut. */
125
  public static final Tag MICRONAUT = create("micronaut", FRAMEWORK, false, null, JAVA);
12✔
126

127
  /** {@link Tag} for Angular. */
128
  public static final Tag ANGULAR = create("angular", FRAMEWORK, false, new String[] { "ng", "angularjs" },
21✔
129
      TYPE_SCRIPT);
130

131
  /** {@link Tag} for React. */
132
  public static final Tag REACT = create("react", FRAMEWORK, false, null, TYPE_SCRIPT);
12✔
133

134
  /** {@link Tag} for Vue. */
135
  public static final Tag VUE = create("vue", FRAMEWORK, false, null, TYPE_SCRIPT);
12✔
136

137
  /** {@link Tag} for Cordova. */
138
  public static final Tag CORDOVA = create("cordova", FRAMEWORK, false, null, JAVA_SCRIPT);
12✔
139

140
  /** {@link Tag} for Ionic. */
141
  public static final Tag IONIC = create("ionic", CORDOVA, false);
5✔
142

143
  /** {@link #getParent() Parent} for quality-assurance. */
144
  public static final Tag QA = create("quality-assurance", ROOT, false, "qa", "quality");
15✔
145

146
  /** {@link Tag} for everything related to testing. */
147
  public static final Tag TEST = create("testing", QA, false, "test");
6✔
148

149
  /** {@link Tag} for everything related to testing. */
150
  public static final Tag MOCK = create("mocking", TEST, false, "mock");
6✔
151

152
  /** {@link Tag} for everything related to testing. */
153
  public static final Tag CODE_QA = create("static-code-analysis", QA, false, "codeqa");
6✔
154

155
  /** {@link #getParent() Parent} for linters. */
156
  public static final Tag LINTING = create("linter", QA, false, "lint", "linting");
15✔
157

158
  /** {@link Tag} for everything related to documentation. */
159
  public static final Tag DOCUMENTATION = create("documentation", ROOT, false, "doc");
6✔
160

161
  /** {@link #getParent() Parent} for file formats. */
162
  public static final Tag FORMAT = create("format", ROOT, true);
5✔
163

164
  /** {@link Tag} for JSON. */
165
  public static final Tag JSON = create("json", FORMAT);
4✔
166

167
  /** {@link Tag} for YAML. */
168
  public static final Tag YAML = create("yaml", FORMAT, false, "yml");
6✔
169

170
  /** {@link Tag} for CSS. */
171
  public static final Tag CSS = create("css", FORMAT);
4✔
172

173
  /** {@link Tag} for Properties. */
174
  public static final Tag PROPERTIES = create("properties", FORMAT);
4✔
175

176
  /** {@link Tag} for AsciiDoc. */
177
  public static final Tag ASCII_DOC = create("ascii-doc", FORMAT, false, new String[] { "adoc" }, DOCUMENTATION);
17✔
178

179
  /** {@link Tag} for MarkDown. */
180
  public static final Tag MARK_DOWN = create("markdown", DOCUMENTATION, false, new String[] { "md" }, DOCUMENTATION);
17✔
181

182
  /** {@link Tag} for YAML. */
183
  public static final Tag PDF = create("pdf", FORMAT, false, null, DOCUMENTATION);
12✔
184

185
  /** {@link Tag} for HTML. */
186
  public static final Tag HTML = create("html", FORMAT, false, null, DOCUMENTATION);
12✔
187

188
  /** {@link Tag} for machine-learning. */
189
  public static final Tag MACHINE_LEARNING = create("machine-learning", ROOT, false, "ml");
6✔
190

191
  /** {@link Tag} for artificial-intelligence. */
192
  public static final Tag ARTIFICIAL_INTELLIGENCE = create("artificial-intelligence", MACHINE_LEARNING, false, "ai");
6✔
193

194
  /** {@link Tag} for data-science. */
195
  public static final Tag DATA_SCIENCE = create("data-science", ROOT);
4✔
196

197
  /** {@link Tag} for business-intelligence. */
198
  public static final Tag BUSINESS_INTELLIGENCE = create("business-intelligence", ROOT, false, "bi", "datawarehouse",
19✔
199
      "dwh");
200

201
  /** {@link #Tag} for productivity. */
202
  public static final Tag ARCHITECTURE = create("architecture", ROOT);
4✔
203

204
  /** {@link Tag} for AsciiDoc. */
205
  public static final Tag UML = create("uml", ARCHITECTURE, false, null, DOCUMENTATION);
12✔
206

207
  /** {@link #Tag} for security. */
208
  public static final Tag SECURITY = create("security", ROOT, false, "cve");
6✔
209

210
  /** {@link #Tag} for collaboration. */
211
  public static final Tag COLLABORATION = create("collaboration", ROOT, false, "collab");
6✔
212

213
  /** {@link #Tag} for virtualization. */
214
  public static final Tag VIRTUALIZATION = create("virtualization", ROOT, false, "vm");
6✔
215

216
  /** {@link #Tag} for docker. */
217
  public static final Tag DOCKER = create("docker", VIRTUALIZATION);
4✔
218

219
  /** {@link #Tag} for docker. */
220
  public static final Tag KUBERNETES = create("kubernetes", DOCKER, false, "k8s");
6✔
221

222
  /** {@link #Tag} for WSL. */
223
  public static final Tag WSL = create("wsl", VIRTUALIZATION);
4✔
224

225
  /** {@link Tag} for everything related to databases. */
226
  public static final Tag DB = create("database", ROOT);
4✔
227

228
  /** {@link Tag} for administration tools. */
229
  public static final Tag ADMIN = create("admin", ROOT);
4✔
230

231
  /** {@link #Tag} for network. */
232
  public static final Tag NETWORK = create("network", ROOT, false, "remote");
6✔
233

234
  /** {@link #Tag} for HTTP. */
235
  public static final Tag HTTP = create("http", NETWORK);
4✔
236

237
  /** {@link #Tag} for REST. */
238
  public static final Tag REST = create("rest", HTTP);
4✔
239

240
  /** {@link #Tag} for secure-shell. */
241
  public static final Tag SSH = create("secure-shell", NETWORK, false, "ssh", "scp");
15✔
242

243
  /** {@link #Tag} for capture. */
244
  public static final Tag CAPTURE = create("capture", ROOT, false, "capturing");
6✔
245

246
  /** {@link #Tag} for capture. */
247
  public static final Tag SCREENSHOT = create("screenshot", CAPTURE);
4✔
248

249
  /** {@link #Tag} for capture. */
250
  public static final Tag SCREEN_RECORDING = create("screenrecording", CAPTURE, false, "videocapture");
6✔
251

252
  /** {@link #Tag} for productivity. */
253
  public static final Tag PRODUCTIVITY = create("productivity", ROOT);
4✔
254

255
  /** {@link #Tag} for regular-expression. */
256
  public static final Tag REGEX = create("regular-expression", PRODUCTIVITY, false, "regex", "regexp");
15✔
257

258
  /** {@link #Tag} for search. */
259
  public static final Tag SEARCH = create("search", PRODUCTIVITY, false, "find");
6✔
260

261
  /** {@link #Tag} for spellchecker. */
262
  public static final Tag SPELLCHECKER = create("spellchecker", PRODUCTIVITY, false, "spellcheck", "spellchecking");
15✔
263

264
  /** {@link #Tag} for analyse. */
265
  public static final Tag ANALYSE = create("analyse", ROOT, false, "analyze", "analysis");
15✔
266

267
  /** {@link #Tag} for monitoring. */
268
  public static final Tag MONITORING = create("monitoring", ANALYSE, false, "monitor");
6✔
269

270
  /** {@link #Tag} for formatter. */
271
  public static final Tag FORMATTER = create("formatter", ROOT, false, "codeformat", "codeformatter");
15✔
272

273
  /** {@link #Tag} for user-experience. */
274
  public static final Tag UX = create("user-experience", PRODUCTIVITY, false, "ux");
6✔
275

276
  /** {@link #Tag} for style. */
277
  public static final Tag STYLE = create("style", UX, false, "theme", "icon", "skin");
19✔
278

279
  /** {@link #Tag} for style. */
280
  public static final Tag KEYBINDING = create("keybinding", UX, false, "keybindings", "keymap");
15✔
281

282
  /** {@link #Tag} for draw(ing). */
283
  public static final Tag DRAW = create("draw", UX, false, "diagram", "paint");
15✔
284

285
  /** {@link #Tag} for cloud. */
286
  public static final Tag CLOUD = create("cloud", ROOT);
4✔
287

288
  /** {@link #Tag} for infrastructure-as-code. */
289
  public static final Tag IAC = create("infrastructure-as-code", CLOUD, false, "iac");
6✔
290

291
  /** {@link #Tag} for software-configuration-management. */
292
  public static final Tag CONFIG_MANAGEMENT = create("software-configuration-management", ROOT, false,
15✔
293
      "configmanagement", "configurationmanagement");
294

295
  /** {@link #Tag} for build-management. */
296
  public static final Tag BUILD = create("build-management", CONFIG_MANAGEMENT, false, "build");
6✔
297

298
  /** {@link #Tag} for version-control. */
299
  public static final Tag VCS = create("version-control", CONFIG_MANAGEMENT, false, "vcs", "versioncontrolsystem");
15✔
300

301
  /** {@link #Tag} for issue-management. */
302
  public static final Tag ISSUE = create("issue-management", CONFIG_MANAGEMENT, false, "issue");
6✔
303

304
  /** {@link #Tag} for git. */
305
  public static final Tag GIT = create("git", VCS);
4✔
306

307
  /** {@link #Tag} for github. */
308
  public static final Tag GITHUB = create("github", GIT);
4✔
309

310

311
  /** {@link #Tag} for diff (tools that compare files and determine the difference). */
312
  public static final Tag DIFF = create("diff", CONFIG_MANAGEMENT, false, "patch");
6✔
313

314
  /** {@link #Tag} for diff (tools that compare files and determine the difference). */
315
  public static final Tag RUNTIME = create("runtime", ROOT);
4✔
316

317
  /** {@link #getParent() Parent} for operating-system. */
318
  public static final Tag OS = create("operating-system", ROOT, true, "os");
6✔
319

320
  /** {@link #Tag} for Windows. */
321
  public static final Tag WINDOWS = create("windows", OS);
4✔
322

323
  /** {@link #Tag} for Mac. */
324
  public static final Tag MAC = create("mac", OS, false, "macos", "osx");
15✔
325

326
  /** {@link #Tag} for Linux. */
327
  public static final Tag LINUX = create("linux", OS, false);
5✔
328

329
  /** {@link #getParent() Parent} for cryptography. */
330
  public static final Tag CRYPTO = create("cryptography", ROOT, false, "crypto");
6✔
331

332
  /** {@link #Tag} for encryption. */
333
  public static final Tag ENCRYPTION = create("encryption", CRYPTO);
4✔
334

335
  /** {@link Tag} for Nest. */
336
  public static final Tag NEST = create("nest", FRAMEWORK, false, new String[] { "nestjs", "nestcli" }, TYPE_SCRIPT);
22✔
337

338
  private final String id;
339

340
  private final Tag parent;
341

342
  private final boolean isAbstract;
343

344
  private final Tag[] additionalParents;
345

346
  private Tag() {
2✔
347

348
    this.id = "<root>";
3✔
349
    this.parent = null;
3✔
350
    this.isAbstract = true;
3✔
351
    this.additionalParents = NO_TAGS;
3✔
352
  }
1✔
353

354
  private Tag(String id, Tag parent, boolean isAbstract, Tag... additionalParents) {
355

356
    super();
2✔
357
    Objects.requireNonNull(id);
3✔
358
    Objects.requireNonNull(parent);
3✔
359
    assert (id.toLowerCase(Locale.ROOT).equals(id));
7!
360
    this.id = id;
3✔
361
    this.parent = parent;
3✔
362
    this.isAbstract = isAbstract;
3✔
363
    this.additionalParents = additionalParents;
3✔
364
  }
1✔
365

366
  /**
367
   * @return the identifier and name of this tag.
368
   */
369
  public String getId() {
370

371
    return this.id;
3✔
372
  }
373

374
  /**
375
   * @return the parent {@link Tag} or {@code null} if this is the root tag.
376
   */
377
  public Tag getParent() {
378

379
    return this.parent;
3✔
380
  }
381

382
  /**
383
   * @param i the index of the requested parent. Should be in the range from {@code 0} to
384
   *     <code>{@link #getParentCount()}-1</code>.
385
   * @return the requested {@link Tag}.
386
   */
387
  public Tag getParent(int i) {
388

389
    if (i == 0) {
2✔
390
      return this.parent;
3✔
391
    }
392
    return this.additionalParents[i - 1];
7✔
393
  }
394

395
  /**
396
   * @return the number of {@link #getParent(int) parents} available.
397
   */
398
  public int getParentCount() {
399

400
    if (this.parent == null) {
3✔
401
      return 0;
2✔
402
    }
403
    return this.additionalParents.length + 1;
6✔
404
  }
405

406
  /**
407
   * @return {@code true} if this {@link Tag} is abstract and cannot be selected since it is just a generic parent container, {@code false} otherwise.
408
   */
409
  public boolean isAbstract() {
410

411
    return this.isAbstract;
3✔
412
  }
413

414
  public boolean isAncestorOf(Tag tag) {
415

416
    return isAncestorOf(tag, false);
5✔
417
  }
418

419
  /**
420
   * @param tag the {@link Tag} to check.
421
   * @param includeAdditionalParents - {@code true} if {@link #getParent(int) additional parents} should be included, {@code false} otherwise (only consider
422
   *     {@link #getParent() primary parent}).
423
   * @return {@code true} if the given {@link Tag} is an ancestor of this tag, {@code false} otherwise. An ancestor is a direct or indirect
424
   *     {@link #getParent() parent}. Therefore, if {@link #ROOT} is given as {@link Tag} parameter, this method should always return {@code true}.
425
   */
426
  public boolean isAncestorOf(Tag tag, boolean includeAdditionalParents) {
427

428
    Tag ancestor = this.parent;
3✔
429
    while (ancestor != null) {
2✔
430
      if (ancestor == tag) {
3✔
431
        return true;
2✔
432
      }
433
      ancestor = ancestor.parent;
4✔
434
    }
435
    if (includeAdditionalParents) {
2✔
436
      for (Tag p : this.additionalParents) {
17✔
437
        do {
438
          if (p == tag) {
3✔
439
            return true;
2✔
440
          }
441
          p = p.parent;
3✔
442
        } while (p != null);
2✔
443
      }
444
    }
445
    return false;
2✔
446
  }
447

448
  @Override
449
  public String toString() {
450

451
    return this.id;
3✔
452
  }
453

454
  /**
455
   * @param id the {@link #getId() ID} of the tag.
456
   * @param parent the {@link #getParent() parent tag}.
457
   * @return the new {@link Tag}.
458
   */
459
  static Tag create(String id, Tag parent) {
460

461
    return create(id, parent, false);
5✔
462
  }
463

464
  /**
465
   * @param id the {@link #getId() ID} of the tag.
466
   * @param parent the {@link #getParent() parent tag}.
467
   * @param isAbstract the {@link #isAbstract() abstract flag}.
468
   * @return the new {@link Tag}.
469
   */
470
  static Tag create(String id, Tag parent, boolean isAbstract) {
471

472
    return create(id, parent, isAbstract, null, NO_TAGS);
7✔
473
  }
474

475
  /**
476
   * @param id the {@link #getId() ID} of the tag.
477
   * @param parent the {@link #getParent() parent tag}.
478
   * @param isAbstract the {@link #isAbstract() abstract flag}.
479
   * @return the new {@link Tag}.
480
   */
481
  static Tag create(String id, Tag parent, boolean isAbstract, String synonym) {
482

483
    return create(id, parent, isAbstract, new String[] { synonym }, NO_TAGS);
12✔
484
  }
485

486
  /**
487
   * @param id the {@link #getId() ID} of the tag.
488
   * @param parent the {@link #getParent() parent tag}.
489
   * @param isAbstract the {@link #isAbstract() abstract flag}.
490
   * @return the new {@link Tag}.
491
   */
492
  static Tag create(String id, Tag parent, boolean isAbstract, String... synonyms) {
493

494
    return create(id, parent, isAbstract, synonyms, NO_TAGS);
7✔
495
  }
496

497
  /**
498
   * @param id the {@link #getId() ID} of the tag.
499
   * @param parent the {@link #getParent() parent tag}.
500
   * @param isAbstract the {@link #isAbstract() abstract flag}.
501
   * @return the new {@link Tag}.
502
   */
503
  static Tag create(String id, Tag parent, boolean isAbstract, String[] synonyms, Tag... additionalParents) {
504

505
    Tag tag = new Tag(id, parent, isAbstract, additionalParents);
8✔
506
    add(id, tag);
3✔
507
    if (synonyms != null) {
2✔
508
      for (String synonym : synonyms) {
16✔
509
        add(synonym, tag);
3✔
510
      }
511
    }
512
    return tag;
2✔
513
  }
514

515
  private static void add(String key, Tag tag) {
516

517
    Tag duplicate = TAG_MAP.put(normalizeKey(key), tag);
7✔
518
    if (duplicate != null) {
2✔
519
      throw new IllegalStateException("Duplicate tag for " + key);
6✔
520
    }
521
  }
1✔
522

523
  private static String normalizeKey(String key) {
524

525
    return key.replace("-", "").replace(".", "");
8✔
526
  }
527

528
  private static Tag require(String key) {
529

530
    Tag tag = TAG_MAP.get(normalizeKey(key));
6✔
531
    if (tag == null) {
2!
532
      throw new IllegalStateException("Could not find required tag " + key);
×
533
    }
534
    return tag;
2✔
535
  }
536

537
  /**
538
   * @param id the {@link #getId() ID} of the requested {@link Tag}.
539
   * @return the {@link Tag} with the given {@link #getId() ID}. Will be lazily created as child of {@link #MISC} if not already exists.
540
   */
541
  public static Tag of(String id) {
542

543
    final String tagId = id.trim();
3✔
544
    int slash = tagId.indexOf('/');
4✔
545
    if (slash >= 0) {
2✔
546
      String parentId = tagId.substring(0, slash);
5✔
547
      Tag parent = require(parentId);
3✔
548
      String childId = tagId.substring(slash + 1);
6✔
549
      return TAG_MAP.computeIfAbsent(normalizeKey(childId), i -> new Tag(childId, parent, false, NO_TAGS));
17✔
550
    }
551
    return TAG_MAP.computeIfAbsent(normalizeKey(tagId), i -> new Tag(tagId, MISC, false, NO_TAGS));
16✔
552
  }
553

554
  /**
555
   * @return the {@link Collections} of all available {@link Tag}s.
556
   */
557
  public static Collection<Tag> getAll() {
558

559
    return ALL_TAGS;
2✔
560
  }
561

562
  /**
563
   * @param tagsCsv the tags as {@link String} in CSV format («first-tag»,...,«last-tag»). May be {@code null} or empty.
564
   * @return the parsed {@link Set} of {@link Tag}s.
565
   */
566
  public static Set<Tag> parseCsv(String tagsCsv) {
567

568
    if (tagsCsv == null) {
2✔
569
      return Collections.emptySet();
2✔
570
    }
571
    tagsCsv = tagsCsv.trim().toLowerCase(Locale.ROOT);
5✔
572
    if (tagsCsv.isEmpty()) {
3✔
573
      return Collections.emptySet();
2✔
574
    }
575
    String[] tagArray = tagsCsv.split(",");
4✔
576
    Set<Tag> tags = new HashSet<>(tagArray.length);
6✔
577
    for (String tag : tagArray) {
16✔
578
      tags.add(of(tag));
5✔
579
    }
580
    assert (tags.size() == tagArray.length);
6!
581
    return Set.of(tags.toArray(new Tag[tags.size()]));
8✔
582
  }
583

584
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc