@Test(expected = IllegalStateException.class) public void ofMissingArtifactId() { Gavtc.of("g"); }
public static Gavtc of(String gavtcString) { StringTokenizer st = new StringTokenizer(gavtcString, ":"); if (!st.hasMoreTokens()) { throw new IllegalStateException( String.format("Cannot parse [%s] to a " + Gav.class.getName(), gavtcString)); } else { final String g = st.nextToken(); if (!st.hasMoreTokens()) { throw new IllegalStateException( String.format("Cannot parse [%s] to a " + Gavtc.class.getName(), gavtcString)); } else { final String a = st.nextToken(); if (!st.hasMoreTokens()) { throw new IllegalStateException( String.format("Cannot parse [%s] to a " + Gavtc.class.getName(), gavtcString)); } else { final String v = st.nextToken(); if (!st.hasMoreTokens()) { throw new IllegalStateException( String.format("Cannot parse [%s] to a " + Gavtc.class.getName(), gavtcString)); } else { final String t = st.nextToken(); final String c = st.hasMoreTokens() ? st.nextToken() : null; return new Gavtc(g, a, v, t, c); } } } } }
Gavtc extends Gav { public static Gavtc of(String gavtcString) { StringTokenizer st = new StringTokenizer(gavtcString, ":"); if (!st.hasMoreTokens()) { throw new IllegalStateException( String.format("Cannot parse [%s] to a " + Gav.class.getName(), gavtcString)); } else { final String g = st.nextToken(); if (!st.hasMoreTokens()) { throw new IllegalStateException( String.format("Cannot parse [%s] to a " + Gavtc.class.getName(), gavtcString)); } else { final String a = st.nextToken(); if (!st.hasMoreTokens()) { throw new IllegalStateException( String.format("Cannot parse [%s] to a " + Gavtc.class.getName(), gavtcString)); } else { final String v = st.nextToken(); if (!st.hasMoreTokens()) { throw new IllegalStateException( String.format("Cannot parse [%s] to a " + Gavtc.class.getName(), gavtcString)); } else { final String t = st.nextToken(); final String c = st.hasMoreTokens() ? st.nextToken() : null; return new Gavtc(g, a, v, t, c); } } } } } }
Gavtc extends Gav { public static Gavtc of(String gavtcString) { StringTokenizer st = new StringTokenizer(gavtcString, ":"); if (!st.hasMoreTokens()) { throw new IllegalStateException( String.format("Cannot parse [%s] to a " + Gav.class.getName(), gavtcString)); } else { final String g = st.nextToken(); if (!st.hasMoreTokens()) { throw new IllegalStateException( String.format("Cannot parse [%s] to a " + Gavtc.class.getName(), gavtcString)); } else { final String a = st.nextToken(); if (!st.hasMoreTokens()) { throw new IllegalStateException( String.format("Cannot parse [%s] to a " + Gavtc.class.getName(), gavtcString)); } else { final String v = st.nextToken(); if (!st.hasMoreTokens()) { throw new IllegalStateException( String.format("Cannot parse [%s] to a " + Gavtc.class.getName(), gavtcString)); } else { final String t = st.nextToken(); final String c = st.hasMoreTokens() ? st.nextToken() : null; return new Gavtc(g, a, v, t, c); } } } } } Gavtc(String groupId, String artifactId, String version, String type);  Gavtc(String groupId, String artifactId, String version, String type, String classifier); }
Gavtc extends Gav { public static Gavtc of(String gavtcString) { StringTokenizer st = new StringTokenizer(gavtcString, ":"); if (!st.hasMoreTokens()) { throw new IllegalStateException( String.format("Cannot parse [%s] to a " + Gav.class.getName(), gavtcString)); } else { final String g = st.nextToken(); if (!st.hasMoreTokens()) { throw new IllegalStateException( String.format("Cannot parse [%s] to a " + Gavtc.class.getName(), gavtcString)); } else { final String a = st.nextToken(); if (!st.hasMoreTokens()) { throw new IllegalStateException( String.format("Cannot parse [%s] to a " + Gavtc.class.getName(), gavtcString)); } else { final String v = st.nextToken(); if (!st.hasMoreTokens()) { throw new IllegalStateException( String.format("Cannot parse [%s] to a " + Gavtc.class.getName(), gavtcString)); } else { final String t = st.nextToken(); final String c = st.hasMoreTokens() ? st.nextToken() : null; return new Gavtc(g, a, v, t, c); } } } } } Gavtc(String groupId, String artifactId, String version, String type);  Gavtc(String groupId, String artifactId, String version, String type, String classifier); static Gavtc of(String gavtcString); static List<Gavtc> ofPattern(String gavtcPattern); @Override int compareTo(Gav other); @Override boolean equals(Object obj); String getClassifier(); String getGavtcString(); String getType(); @Override int hashCode(); @Override String toString(); }
Gavtc extends Gav { public static Gavtc of(String gavtcString) { StringTokenizer st = new StringTokenizer(gavtcString, ":"); if (!st.hasMoreTokens()) { throw new IllegalStateException( String.format("Cannot parse [%s] to a " + Gav.class.getName(), gavtcString)); } else { final String g = st.nextToken(); if (!st.hasMoreTokens()) { throw new IllegalStateException( String.format("Cannot parse [%s] to a " + Gavtc.class.getName(), gavtcString)); } else { final String a = st.nextToken(); if (!st.hasMoreTokens()) { throw new IllegalStateException( String.format("Cannot parse [%s] to a " + Gavtc.class.getName(), gavtcString)); } else { final String v = st.nextToken(); if (!st.hasMoreTokens()) { throw new IllegalStateException( String.format("Cannot parse [%s] to a " + Gavtc.class.getName(), gavtcString)); } else { final String t = st.nextToken(); final String c = st.hasMoreTokens() ? st.nextToken() : null; return new Gavtc(g, a, v, t, c); } } } } } Gavtc(String groupId, String artifactId, String version, String type);  Gavtc(String groupId, String artifactId, String version, String type, String classifier); static Gavtc of(String gavtcString); static List<Gavtc> ofPattern(String gavtcPattern); @Override int compareTo(Gav other); @Override boolean equals(Object obj); String getClassifier(); String getGavtcString(); String getType(); @Override int hashCode(); @Override String toString();  }