Package com.helger.diver.api.coord
Class DVRCoordinate
java.lang.Object
com.helger.diver.api.coord.DVRCoordinate
- All Implemented Interfaces:
IDVRCoordinate,Comparable<DVRCoordinate>
@Immutable
@MustImplementComparable
@MustImplementEqualsAndHashcode
public final class DVRCoordinate
extends Object
implements IDVRCoordinate, Comparable<DVRCoordinate>
The DVR Coordinate represents the coordinate of a single technical artefact
in a specific version.
It was originally called VESID for "Validation Executor Set ID" but is now used in a wider range of use cases. The name was changed for release v2 to DVRID. In v3 the name was changed again to DVR Coordinate.
It was originally called VESID for "Validation Executor Set ID" but is now used in a wider range of use cases. The name was changed for release v2 to DVRID. In v3 the name was changed again to DVR Coordinate.
- Author:
- Philip Helger
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final charThe separator char between ID elements -
Constructor Summary
ConstructorsConstructorDescriptionDVRCoordinate(String sGroupID, String sArtifactID, DVRVersion aVersion) Constructor.DVRCoordinate(String sGroupID, String sArtifactID, DVRVersion aVersion, String sClassifier) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic intcompare(DVRCoordinate aLeft, DVRCoordinate aRight) intcompareTo(DVRCoordinate aOther) static DVRCoordinateFactory method without classifier.static DVRCoordinateFactory method for DVR coordinates.booleanstatic StringgetAsSingleID(String sGroupID, String sArtifactID, String sVersion, String sClassifier) getWithArtifactID(String sNewArtifactID) getWithClassifier(String sNewClassifier) getWithGroupID(String sNewGroupID) getWithVersion(DVRVersion aNewVersion) getWithVersion(IDVRPseudoVersion aPseudoVersion) inthashCode()static DVRCoordinateparseOrNull(String sCoords) static DVRCoordinateparseOrThrow(String sCoords) Try to parse the provided coordinates String.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.helger.diver.api.coord.IDVRCoordinate
getVersionString, hasClassifier
-
Field Details
-
PART_SEPARATOR
public static final char PART_SEPARATORThe separator char between ID elements- See Also:
-
-
Constructor Details
-
DVRCoordinate
public DVRCoordinate(@Nonnull @Nonempty String sGroupID, @Nonnull @Nonempty String sArtifactID, @Nonnull DVRVersion aVersion) Constructor. All parameters must match the constraints fromDVRValidityHelper.isValidCoordinateGroupID(String),DVRValidityHelper.isValidCoordinateArtifactID(String)andDVRValidityHelper.isValidCoordinateVersion(String).- Parameters:
sGroupID- Group ID. May neither benullnor empty.sArtifactID- Artifact ID. May neither benullnor empty.aVersion- Version object. May not benull.- Since:
- 1.1.2
-
DVRCoordinate
public DVRCoordinate(@Nonnull @Nonempty String sGroupID, @Nonnull @Nonempty String sArtifactID, @Nonnull DVRVersion aVersion, @Nullable String sClassifier) Constructor. All parameters must match the constraints fromDVRValidityHelper.isValidCoordinateGroupID(String),DVRValidityHelper.isValidCoordinateArtifactID(String),DVRValidityHelper.isValidCoordinateVersion(String)andDVRValidityHelper.isValidCoordinateClassifier(String).- Parameters:
sGroupID- Group ID. May neither benullnor empty.sArtifactID- Artifact ID. May neither benullnor empty.aVersion- Version object. May not benull.sClassifier- Classifier. May benull.
-
-
Method Details
-
getGroupID
- Specified by:
getGroupIDin interfaceIDVRCoordinate- Returns:
- The coordinate's group ID. May never be
nullnor empty.
-
getArtifactID
- Specified by:
getArtifactIDin interfaceIDVRCoordinate- Returns:
- The coordinate's artifact ID. May never be
nullnor empty.
-
getVersionObj
- Specified by:
getVersionObjin interfaceIDVRCoordinate- Returns:
- The coordinates version object. Never
null.
-
getClassifier
- Specified by:
getClassifierin interfaceIDVRCoordinate- Returns:
- The coordinate's optional classifier ID. May be
nullor empty.
-
getWithGroupID
-
getWithArtifactID
-
getWithVersion
-
getWithVersion
-
getWithVersionLatest
-
getWithVersionLatestRelease
-
getWithClassifier
-
getAsSingleID
-
getAsSingleID
- Specified by:
getAsSingleIDin interfaceIDVRCoordinate- Returns:
- A joint String representation of the coordinates. The different
parts are separated by a colon (:) character. Never
nullnor empty.
-
compare
-
compareTo
- Specified by:
compareToin interfaceComparable<DVRCoordinate>
-
equals
-
hashCode
public int hashCode() -
toString
-
create
@Nonnull public static DVRCoordinate create(@Nonnull @Nonempty String sGroupID, @Nonnull @Nonempty String sArtifactID, @Nonnull @Nonempty String sVersion) throws DVRVersionException Factory method without classifier. All parameters must match the constraints fromDVRValidityHelper.isValidCoordinateGroupID(String),DVRValidityHelper.isValidCoordinateArtifactID(String)andDVRValidityHelper.isValidCoordinateVersion(String).- Parameters:
sGroupID- Group ID. May neither benullnor empty.sArtifactID- Artifact ID. May neither benullnor empty.sVersion- Version string. May neither benullnor empty.- Returns:
- The created
DVRCoordinateand nevernull. - Throws:
DVRVersionException- if the provided version is invalid
-
create
@Nonnull public static DVRCoordinate create(@Nonnull @Nonempty String sGroupID, @Nonnull @Nonempty String sArtifactID, @Nonnull @Nonempty String sVersion, @Nullable String sClassifier) throws DVRVersionException Factory method for DVR coordinates. All parameters must match the constraints fromDVRValidityHelper.isValidCoordinateGroupID(String),DVRValidityHelper.isValidCoordinateArtifactID(String),DVRValidityHelper.isValidCoordinateVersion(String)andDVRValidityHelper.isValidCoordinateClassifier(String).- Parameters:
sGroupID- Group ID. May neither benullnor empty.sArtifactID- Artifact ID. May neither benullnor empty.sVersion- Version string. May neither benullnor empty.sClassifier- Classifier. May benull.- Returns:
- The created
DVRCoordinateand nevernull. - Throws:
DVRVersionException- if the provided version is invalid
-
parseOrThrow
@Nonnull public static DVRCoordinate parseOrThrow(@Nullable String sCoords) throws DVRCoordinateException, DVRVersionException Try to parse the provided coordinates String. This is the reverse operation togetAsSingleID().- Parameters:
sCoords- The coordinate string to parse. May benull.- Returns:
- Never
null - Throws:
DVRCoordinateException- In case the layout is incorrectDVRVersionException- In case the version is incorrect
-
parseOrNull
-