@Test void compareTo() { assertCompareTo(0, toExtension("id", "2.0"), toExtension("id", "2.0")); assertCompareTo(-1, toExtension("id", "2.0"), toExtension("id", "3.0")); assertCompareTo(1, toExtension("id", "2.0"), toExtension("id", "1.0")); assertCompareTo(0, toExtension("feature", "2.0"), toExtension("id", "2.0", new ExtensionId("feature", "2.0"))); assertCompareTo(-1, toExtension("feature", "2.0"), toExtension("id", "2.0", new ExtensionId("feature", "3.0"))); assertCompareTo(1, toExtension("feature", "2.0"), toExtension("id", "2.0", new ExtensionId("feature", "1.0"))); assertCompareTo(0, toExtension("id", "2.0", new ExtensionId("feature", "2.0")), toExtension("feature", "2.0")); assertCompareTo(-1, toExtension("id", "2.0", new ExtensionId("feature", "2.0")), toExtension("feature", "3.0")); assertCompareTo(1, toExtension("id", "2.0", new ExtensionId("feature", "2.0")), toExtension("feature", "1.0")); assertCompareTo(-1, toExtension("id", "1.0"), toExtension("id2", "1.0")); assertCompareTo(-1, toExtension("id", "1.0"), null); }
@Override public int compareTo(Extension o) { if (o == null) { return -1; } Integer comparizon = compareTo(this, o); if (comparizon != null) { return comparizon; } comparizon = compareTo(o, this); if (comparizon != null) { return comparizon; } return ObjectUtils.compare(getId(), o.getId()); }
AbstractExtension implements MutableExtension { @Override public int compareTo(Extension o) { if (o == null) { return -1; } Integer comparizon = compareTo(this, o); if (comparizon != null) { return comparizon; } comparizon = compareTo(o, this); if (comparizon != null) { return comparizon; } return ObjectUtils.compare(getId(), o.getId()); } }
AbstractExtension implements MutableExtension { @Override public int compareTo(Extension o) { if (o == null) { return -1; } Integer comparizon = compareTo(this, o); if (comparizon != null) { return comparizon; } comparizon = compareTo(o, this); if (comparizon != null) { return comparizon; } return ObjectUtils.compare(getId(), o.getId()); } AbstractExtension(ExtensionRepository repository, ExtensionId id, String type);  AbstractExtension(ExtensionRepository repository, Extension extension); }
AbstractExtension implements MutableExtension { @Override public int compareTo(Extension o) { if (o == null) { return -1; } Integer comparizon = compareTo(this, o); if (comparizon != null) { return comparizon; } comparizon = compareTo(o, this); if (comparizon != null) { return comparizon; } return ObjectUtils.compare(getId(), o.getId()); } AbstractExtension(ExtensionRepository repository, ExtensionId id, String type);  AbstractExtension(ExtensionRepository repository, Extension extension); @Override void set(Extension extension); @Override T get(String fieldName); @Override ExtensionId getId(); @Override @Deprecated Collection<String> getFeatures(); @Override @Deprecated void setFeatures(Collection<String> features); @Override @Deprecated void addFeature(String feature); @Override Collection<ExtensionId> getExtensionFeatures(); @Override ExtensionId getExtensionFeature(String featureId); @Override void setExtensionFeatures(Collection<ExtensionId> features); @Override void addExtensionFeature(ExtensionId feature); @Override String getType(); @Override String getName(); @Override void setName(String name); @Override Collection<ExtensionLicense> getLicenses(); @Override void setLicenses(Collection<ExtensionLicense> licenses); @Override void addLicense(ExtensionLicense license); @Override String getSummary(); @Override void setSummary(String summary); @Override String getDescription(); @Override void setDescription(String description); @Override List<ExtensionAuthor> getAuthors(); @Override void setAuthors(Collection<? extends ExtensionAuthor> authors); @Override void addAuthor(ExtensionAuthor author); @Override String getWebSite(); @Override void setWebsite(String website); @Override Collection<String> getAllowedNamespaces(); @Override void addAllowedNamespace(String namespace); @Override void setAllowedNamespaces(Collection<String> namespaces); @Override void addDependency(ExtensionDependency dependency); @Override List<ExtensionDependency> getDependencies(); @Override void setDependencies(Collection<? extends ExtensionDependency> dependencies); @Override void addManagedDependency(ExtensionDependency managedDependency); @Override List<ExtensionDependency> getManagedDependencies(); @Override void setManagedDependencies(Collection<? extends ExtensionDependency> managedDependencies); @Override ExtensionRepository getRepository(); @Override ExtensionScm getScm(); @Override void setScm(ExtensionScm scm); @Override ExtensionIssueManagement getIssueManagement(); @Override void setIssueManagement(ExtensionIssueManagement issueManagement); @Override ExtensionFile getFile(); @Override String getCategory(); @Override void setCategory(String categrory); @Override Collection<ExtensionRepositoryDescriptor> getRepositories(); @Override void setRepositories(Collection<? extends ExtensionRepositoryDescriptor> repositories); @Override void addRepository(ExtensionRepositoryDescriptor repository); @Override Map<String, Object> getProperties(); @Override T getProperty(String key); @Override T getProperty(String key, T def); @Override void putProperty(String key, Object value); @Override void setProperties(Map<String, Object> properties); @Override T removeProperty(String key); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); @Override int compareTo(Extension o); }
AbstractExtension implements MutableExtension { @Override public int compareTo(Extension o) { if (o == null) { return -1; } Integer comparizon = compareTo(this, o); if (comparizon != null) { return comparizon; } comparizon = compareTo(o, this); if (comparizon != null) { return comparizon; } return ObjectUtils.compare(getId(), o.getId()); } AbstractExtension(ExtensionRepository repository, ExtensionId id, String type);  AbstractExtension(ExtensionRepository repository, Extension extension); @Override void set(Extension extension); @Override T get(String fieldName); @Override ExtensionId getId(); @Override @Deprecated Collection<String> getFeatures(); @Override @Deprecated void setFeatures(Collection<String> features); @Override @Deprecated void addFeature(String feature); @Override Collection<ExtensionId> getExtensionFeatures(); @Override ExtensionId getExtensionFeature(String featureId); @Override void setExtensionFeatures(Collection<ExtensionId> features); @Override void addExtensionFeature(ExtensionId feature); @Override String getType(); @Override String getName(); @Override void setName(String name); @Override Collection<ExtensionLicense> getLicenses(); @Override void setLicenses(Collection<ExtensionLicense> licenses); @Override void addLicense(ExtensionLicense license); @Override String getSummary(); @Override void setSummary(String summary); @Override String getDescription(); @Override void setDescription(String description); @Override List<ExtensionAuthor> getAuthors(); @Override void setAuthors(Collection<? extends ExtensionAuthor> authors); @Override void addAuthor(ExtensionAuthor author); @Override String getWebSite(); @Override void setWebsite(String website); @Override Collection<String> getAllowedNamespaces(); @Override void addAllowedNamespace(String namespace); @Override void setAllowedNamespaces(Collection<String> namespaces); @Override void addDependency(ExtensionDependency dependency); @Override List<ExtensionDependency> getDependencies(); @Override void setDependencies(Collection<? extends ExtensionDependency> dependencies); @Override void addManagedDependency(ExtensionDependency managedDependency); @Override List<ExtensionDependency> getManagedDependencies(); @Override void setManagedDependencies(Collection<? extends ExtensionDependency> managedDependencies); @Override ExtensionRepository getRepository(); @Override ExtensionScm getScm(); @Override void setScm(ExtensionScm scm); @Override ExtensionIssueManagement getIssueManagement(); @Override void setIssueManagement(ExtensionIssueManagement issueManagement); @Override ExtensionFile getFile(); @Override String getCategory(); @Override void setCategory(String categrory); @Override Collection<ExtensionRepositoryDescriptor> getRepositories(); @Override void setRepositories(Collection<? extends ExtensionRepositoryDescriptor> repositories); @Override void addRepository(ExtensionRepositoryDescriptor repository); @Override Map<String, Object> getProperties(); @Override T getProperty(String key); @Override T getProperty(String key, T def); @Override void putProperty(String key, Object value); @Override void setProperties(Map<String, Object> properties); @Override T removeProperty(String key); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); @Override int compareTo(Extension o);  }