1 package org
.argeo
.api
.slc
;
4 * Adds a dimension to {@link NameVersion} by adding an arbitrary category (e.g.
5 * Maven groupId, yum repository ID, etc.)
7 public interface CategoryNameVersion
extends NameVersion
{
8 /** The category of the component. */
11 static CategoryNameVersion
parseCategoryNameVersion(String str
) {
12 if (str
== null || "".equals(str
.trim()))
13 throw new IllegalArgumentException("At least one character required.");
14 String
[] arr
= str
.trim().split(":");
16 throw new IllegalArgumentException(str
+ " does not respect the [category]:[name]:[version] pattern");
17 DefaultCategoryNameVersion res
= new DefaultCategoryNameVersion();
18 res
.setCategory(arr
[0]);
22 res
.setVersion(arr
[2]);