@Test public void getClassifier() { DependencyAtom dependencyAtom = new DependencyAtom("net.ocheyedan", "ply", "1.0"); assertNull(dependencyAtom.getClassifier()); DependencyAtom transformed = dependencyAtom.withoutClassifier(); assertNull(transformed.getClassifier()); transformed = dependencyAtom.withClassifier("foo"); assertEquals("foo", transformed.getClassifier()); transformed = dependencyAtom.withClassifier("sources"); assertEquals("sources", transformed.getClassifier()); transformed = transformed.with("zip"); assertEquals("sources", transformed.getClassifier()); dependencyAtom = dependencyAtom.with("zip"); assertNull(dependencyAtom.getClassifier()); }
public String getClassifier() { if (artifactName == null) { return null; } String packaging = getSyntheticPackaging(); String nonClassifierArtifact = composeArtifact(name, version, null, packaging); if (artifactName.equals(nonClassifierArtifact)) { return null; } return artifactName.replace(nonClassifierArtifact.replace("." + packaging, ""), "").replace("." + packaging, "").substring(1); }
DependencyAtom { public String getClassifier() { if (artifactName == null) { return null; } String packaging = getSyntheticPackaging(); String nonClassifierArtifact = composeArtifact(name, version, null, packaging); if (artifactName.equals(nonClassifierArtifact)) { return null; } return artifactName.replace(nonClassifierArtifact.replace("." + packaging, ""), "").replace("." + packaging, "").substring(1); } }
DependencyAtom { public String getClassifier() { if (artifactName == null) { return null; } String packaging = getSyntheticPackaging(); String nonClassifierArtifact = composeArtifact(name, version, null, packaging); if (artifactName.equals(nonClassifierArtifact)) { return null; } return artifactName.replace(nonClassifierArtifact.replace("." + packaging, ""), "").replace("." + packaging, "").substring(1); } DependencyAtom(String namespace, String name, String version, String artifactName, boolean transientDep);  DependencyAtom(String namespace, String name, String version, String artifactName);  DependencyAtom(String namespace, String name, String version, boolean transientDep);  DependencyAtom(String namespace, String name, String version); }
DependencyAtom { public String getClassifier() { if (artifactName == null) { return null; } String packaging = getSyntheticPackaging(); String nonClassifierArtifact = composeArtifact(name, version, null, packaging); if (artifactName.equals(nonClassifierArtifact)) { return null; } return artifactName.replace(nonClassifierArtifact.replace("." + packaging, ""), "").replace("." + packaging, "").substring(1); } DependencyAtom(String namespace, String name, String version, String artifactName, boolean transientDep);  DependencyAtom(String namespace, String name, String version, String artifactName);  DependencyAtom(String namespace, String name, String version, boolean transientDep);  DependencyAtom(String namespace, String name, String version); String getPropertyName(); String getPropertyValue(); String getPropertyValueWithoutTransient(); String getResolvedPropertyValue(); String getArtifactName(); DependencyAtom with(String packaging); DependencyAtom withClassifier(String classifier); DependencyAtom withoutClassifier(); String getClassifier(); String getSyntheticPackaging(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); static boolean isTransient(String atom); static String stripTransient(String atom); static DependencyAtom parse(String atom, AtomicReference<String> error); }
DependencyAtom { public String getClassifier() { if (artifactName == null) { return null; } String packaging = getSyntheticPackaging(); String nonClassifierArtifact = composeArtifact(name, version, null, packaging); if (artifactName.equals(nonClassifierArtifact)) { return null; } return artifactName.replace(nonClassifierArtifact.replace("." + packaging, ""), "").replace("." + packaging, "").substring(1); } DependencyAtom(String namespace, String name, String version, String artifactName, boolean transientDep);  DependencyAtom(String namespace, String name, String version, String artifactName);  DependencyAtom(String namespace, String name, String version, boolean transientDep);  DependencyAtom(String namespace, String name, String version); String getPropertyName(); String getPropertyValue(); String getPropertyValueWithoutTransient(); String getResolvedPropertyValue(); String getArtifactName(); DependencyAtom with(String packaging); DependencyAtom withClassifier(String classifier); DependencyAtom withoutClassifier(); String getClassifier(); String getSyntheticPackaging(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); static boolean isTransient(String atom); static String stripTransient(String atom); static DependencyAtom parse(String atom, AtomicReference<String> error); static final String DEFAULT_PACKAGING; final String namespace; final String name; final String version; final String artifactName; final boolean transientDep; }