Package adams.core.base
Class MavenArtifact
- java.lang.Object
-
- adams.core.base.BaseObject
-
- adams.core.base.AbstractBaseString
-
- adams.core.base.MavenArtifact
-
- All Implemented Interfaces:
CloneHandler<BaseObject>
,Serializable
,Comparable
public class MavenArtifact extends AbstractBaseString
Encapsulates Maven artifacts.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
SEPARATOR
-
Fields inherited from class adams.core.base.BaseObject
m_Internal, m_Properties, SUFFIX_DISPLAY, SUFFIX_VALUE
-
-
Constructor Summary
Constructors Constructor Description MavenArtifact()
Initializes the string with length 0.MavenArtifact(String s)
Initializes the object with the string to parse.MavenArtifact(String groupId, String artifactId, String version)
Initializes the object with the artifact coordinates.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
artifactIdValue()
Returns the artifact ID part, if possible.protected String
getPart(int index)
Returns the specified part of the coordinate triplet.String
getTipText()
Returns a tool tip for the GUI editor (ignored if null is returned).String
groupIdValue()
Returns the group ID part, if possible.boolean
isValid(String value)
Checks whether the string value is a valid presentation for this class.String
versionValue()
Returns the version part, if possible.-
Methods inherited from class adams.core.base.AbstractBaseString
convert, getValue, initialize, isEmpty, length, setValue, stringValue
-
Methods inherited from class adams.core.base.BaseObject
compareTo, equals, getClone, getInternal, getTemplates, getUnicode, hasFavoritesSupport, hashCode, isValidUnicode, newInstance, setUnicode, toObjectArray, toObjectArray, toString, toStringArray, toStringList
-
-
-
-
Field Detail
-
SEPARATOR
public static final String SEPARATOR
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MavenArtifact
public MavenArtifact()
Initializes the string with length 0.
-
MavenArtifact
public MavenArtifact(String s)
Initializes the object with the string to parse.- Parameters:
s
- the string to parse
-
-
Method Detail
-
isValid
public boolean isValid(String value)
Checks whether the string value is a valid presentation for this class.- Overrides:
isValid
in classAbstractBaseString
- Parameters:
value
- the string value to check- Returns:
- true if non-null
-
getPart
protected String getPart(int index)
Returns the specified part of the coordinate triplet.- Parameters:
index
- the index from the triplet to return- Returns:
- the value or empty string if invalid string or index
-
groupIdValue
public String groupIdValue()
Returns the group ID part, if possible.- Returns:
- the group ID
-
artifactIdValue
public String artifactIdValue()
Returns the artifact ID part, if possible.- Returns:
- the artifact ID
-
versionValue
public String versionValue()
Returns the version part, if possible.- Returns:
- the version
-
getTipText
public String getTipText()
Returns a tool tip for the GUI editor (ignored if null is returned).- Specified by:
getTipText
in classAbstractBaseString
- Returns:
- the tool tip
-
-