@Test(expected = IllegalStateException.class) public void ofMissingArtifactId() { Gav.of("g"); }
public static Gav of(String gavString) { StringTokenizer st = new StringTokenizer(gavString, ":"); if (!st.hasMoreTokens()) { throw new IllegalStateException(String.format("Cannot parse [%s] to a " + Gav.class.getName(), gavString)); } else { final String g = st.nextToken(); if (!st.hasMoreTokens()) { throw new IllegalStateException( String.format("Cannot parse [%s] to a " + Gav.class.getName(), gavString)); } else { final String a = st.nextToken(); if (!st.hasMoreTokens()) { throw new IllegalStateException( String.format("Cannot parse [%s] to a " + Gav.class.getName(), gavString)); } else { final String v = st.nextToken(); return new Gav(g, a, v); } } } }
Gav implements Comparable<Gav> { public static Gav of(String gavString) { StringTokenizer st = new StringTokenizer(gavString, ":"); if (!st.hasMoreTokens()) { throw new IllegalStateException(String.format("Cannot parse [%s] to a " + Gav.class.getName(), gavString)); } else { final String g = st.nextToken(); if (!st.hasMoreTokens()) { throw new IllegalStateException( String.format("Cannot parse [%s] to a " + Gav.class.getName(), gavString)); } else { final String a = st.nextToken(); if (!st.hasMoreTokens()) { throw new IllegalStateException( String.format("Cannot parse [%s] to a " + Gav.class.getName(), gavString)); } else { final String v = st.nextToken(); return new Gav(g, a, v); } } } } }
Gav implements Comparable<Gav> { public static Gav of(String gavString) { StringTokenizer st = new StringTokenizer(gavString, ":"); if (!st.hasMoreTokens()) { throw new IllegalStateException(String.format("Cannot parse [%s] to a " + Gav.class.getName(), gavString)); } else { final String g = st.nextToken(); if (!st.hasMoreTokens()) { throw new IllegalStateException( String.format("Cannot parse [%s] to a " + Gav.class.getName(), gavString)); } else { final String a = st.nextToken(); if (!st.hasMoreTokens()) { throw new IllegalStateException( String.format("Cannot parse [%s] to a " + Gav.class.getName(), gavString)); } else { final String v = st.nextToken(); return new Gav(g, a, v); } } } } Gav(String groupId, String artifactId, String version); }
Gav implements Comparable<Gav> { public static Gav of(String gavString) { StringTokenizer st = new StringTokenizer(gavString, ":"); if (!st.hasMoreTokens()) { throw new IllegalStateException(String.format("Cannot parse [%s] to a " + Gav.class.getName(), gavString)); } else { final String g = st.nextToken(); if (!st.hasMoreTokens()) { throw new IllegalStateException( String.format("Cannot parse [%s] to a " + Gav.class.getName(), gavString)); } else { final String a = st.nextToken(); if (!st.hasMoreTokens()) { throw new IllegalStateException( String.format("Cannot parse [%s] to a " + Gav.class.getName(), gavString)); } else { final String v = st.nextToken(); return new Gav(g, a, v); } } } } Gav(String groupId, String artifactId, String version); static Gav of(String gavString); @Override int compareTo(Gav o); @Override boolean equals(Object obj); String getArtifactId(); String getGroupId(); String getVersion(); @Override int hashCode(); @Override String toString(); }
Gav implements Comparable<Gav> { public static Gav of(String gavString) { StringTokenizer st = new StringTokenizer(gavString, ":"); if (!st.hasMoreTokens()) { throw new IllegalStateException(String.format("Cannot parse [%s] to a " + Gav.class.getName(), gavString)); } else { final String g = st.nextToken(); if (!st.hasMoreTokens()) { throw new IllegalStateException( String.format("Cannot parse [%s] to a " + Gav.class.getName(), gavString)); } else { final String a = st.nextToken(); if (!st.hasMoreTokens()) { throw new IllegalStateException( String.format("Cannot parse [%s] to a " + Gav.class.getName(), gavString)); } else { final String v = st.nextToken(); return new Gav(g, a, v); } } } } Gav(String groupId, String artifactId, String version); static Gav of(String gavString); @Override int compareTo(Gav o); @Override boolean equals(Object obj); String getArtifactId(); String getGroupId(); String getVersion(); @Override int hashCode(); @Override String toString();  }