@Test public void testParseID () { final VESID aID1 = new VESID ("com.helger", "ph-bdve", "3.0.0-SNAPSHOT"); final VESID aID2 = aID1.getWithClassifier ("test"); assertEquals (aID1, VESID.parseIDOrNull (aID1.getAsSingleID ())); assertEquals (aID1, VESID.parseIDOrNull (aID1.getAsSingleID () + VESID.ID_SEPARATOR)); assertEquals (aID2, VESID.parseIDOrNull (aID2.getAsSingleID ())); assertNull (VESID.parseIDOrNull (null)); assertNull (VESID.parseIDOrNull ("a")); assertNull (VESID.parseIDOrNull ("a:b")); assertNull (VESID.parseIDOrNull ("a:b:c:d:e")); assertNull (VESID.parseIDOrNull ("a:b:c:d:e:f")); assertNull (VESID.parseIDOrNull ("::")); assertNull (VESID.parseIDOrNull (":::")); assertNull (VESID.parseIDOrNull ("a:b:")); }
@Nonnull public static VESID parseID (@Nullable final String sVESID) { final ICommonsList <String> aParts = StringHelper.getExploded (ID_SEPARATOR, sVESID); final int nSize = aParts.size (); if (nSize >= 3 && nSize <= 4) return new VESID (aParts.get (0), aParts.get (1), aParts.get (2), nSize >= 4 ? aParts.get (3) : null); throw new IllegalArgumentException ("Invalid VESID '" + sVESID + "' provided!"); }
VESID implements Comparable <VESID> { @Nonnull public static VESID parseID (@Nullable final String sVESID) { final ICommonsList <String> aParts = StringHelper.getExploded (ID_SEPARATOR, sVESID); final int nSize = aParts.size (); if (nSize >= 3 && nSize <= 4) return new VESID (aParts.get (0), aParts.get (1), aParts.get (2), nSize >= 4 ? aParts.get (3) : null); throw new IllegalArgumentException ("Invalid VESID '" + sVESID + "' provided!"); } }
VESID implements Comparable <VESID> { @Nonnull public static VESID parseID (@Nullable final String sVESID) { final ICommonsList <String> aParts = StringHelper.getExploded (ID_SEPARATOR, sVESID); final int nSize = aParts.size (); if (nSize >= 3 && nSize <= 4) return new VESID (aParts.get (0), aParts.get (1), aParts.get (2), nSize >= 4 ? aParts.get (3) : null); throw new IllegalArgumentException ("Invalid VESID '" + sVESID + "' provided!"); } VESID(@Nonnull @Nonempty final String sGroupID,
                @Nonnull @Nonempty final String sArtifactID,
                @Nonnull @Nonempty final String sVersion);  VESID(@Nonnull @Nonempty final String sGroupID,
                @Nonnull @Nonempty final String sArtifactID,
                @Nonnull @Nonempty final String sVersion,
                @Nullable final String sClassifier); }
VESID implements Comparable <VESID> { @Nonnull public static VESID parseID (@Nullable final String sVESID) { final ICommonsList <String> aParts = StringHelper.getExploded (ID_SEPARATOR, sVESID); final int nSize = aParts.size (); if (nSize >= 3 && nSize <= 4) return new VESID (aParts.get (0), aParts.get (1), aParts.get (2), nSize >= 4 ? aParts.get (3) : null); throw new IllegalArgumentException ("Invalid VESID '" + sVESID + "' provided!"); } VESID(@Nonnull @Nonempty final String sGroupID,
                @Nonnull @Nonempty final String sArtifactID,
                @Nonnull @Nonempty final String sVersion);  VESID(@Nonnull @Nonempty final String sGroupID,
                @Nonnull @Nonempty final String sArtifactID,
                @Nonnull @Nonempty final String sVersion,
                @Nullable final String sClassifier); static boolean isValidPart(@Nullable final String sPart); @Nonnull @Nonempty String getGroupID(); @Nonnull @Nonempty String getArtifactID(); @Nonnull @Nonempty String getVersion(); boolean hasClassifier(); @Nullable String getClassifier(); @Nonnull VESID getWithVersion(@Nonnull @Nonempty final String sNewVersion); @Nonnull VESID getWithClassifier(@Nullable final String sNewClassifier); @Nonnull @Nonempty String getAsSingleID(); int compareTo(final VESID aOther); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); @Nonnull static VESID parseID(@Nullable final String sVESID); @Nullable static VESID parseIDOrNull(@Nullable final String sVESID); }
VESID implements Comparable <VESID> { @Nonnull public static VESID parseID (@Nullable final String sVESID) { final ICommonsList <String> aParts = StringHelper.getExploded (ID_SEPARATOR, sVESID); final int nSize = aParts.size (); if (nSize >= 3 && nSize <= 4) return new VESID (aParts.get (0), aParts.get (1), aParts.get (2), nSize >= 4 ? aParts.get (3) : null); throw new IllegalArgumentException ("Invalid VESID '" + sVESID + "' provided!"); } VESID(@Nonnull @Nonempty final String sGroupID,
                @Nonnull @Nonempty final String sArtifactID,
                @Nonnull @Nonempty final String sVersion);  VESID(@Nonnull @Nonempty final String sGroupID,
                @Nonnull @Nonempty final String sArtifactID,
                @Nonnull @Nonempty final String sVersion,
                @Nullable final String sClassifier); static boolean isValidPart(@Nullable final String sPart); @Nonnull @Nonempty String getGroupID(); @Nonnull @Nonempty String getArtifactID(); @Nonnull @Nonempty String getVersion(); boolean hasClassifier(); @Nullable String getClassifier(); @Nonnull VESID getWithVersion(@Nonnull @Nonempty final String sNewVersion); @Nonnull VESID getWithClassifier(@Nullable final String sNewClassifier); @Nonnull @Nonempty String getAsSingleID(); int compareTo(final VESID aOther); @Override boolean equals(final Object o); @Override int hashCode(); @Override String toString(); @Nonnull static VESID parseID(@Nullable final String sVESID); @Nullable static VESID parseIDOrNull(@Nullable final String sVESID); @RegEx
  static final String REGEX_PART; static final char ID_SEPARATOR; }