@Test void get() { assertSame(this.repository, this.extension.get("repository")); assertEquals(this.id.getId(), this.extension.get("id")); assertEquals(this.id.getVersion(), this.extension.get("version")); assertEquals(this.type, this.extension.get("type")); }
@Override public <T> T get(String fieldName) { switch (fieldName.toLowerCase()) { case FIELD_REPOSITORY: return (T) getRepository(); case FIELD_ID: return (T) getId().getId(); case FIELD_VERSION: return (T) getId().getVersion(); case FIELD_FEATURE: case FIELD_FEATURES: return (T) ExtensionIdConverter.toStringList(getExtensionFeatures()); case FIELD_EXTENSIONFEATURE: case FIELD_EXTENSIONFEATURES: return (T) getExtensionFeatures(); case FIELD_SUMMARY: return (T) getSummary(); case FIELD_DESCRIPTION: return (T) getDescription(); case FIELD_AUTHOR: case FIELD_AUTHORS: return (T) getAuthors(); case FIELD_CATEGORY: return (T) getCategory(); case FIELD_LICENSE: case FIELD_LICENSES: return (T) getLicenses(); case FIELD_NAME: return (T) getName(); case FIELD_TYPE: return (T) getType(); case FIELD_WEBSITE: return (T) getWebSite(); case FIELD_NAMESPACES: case FIELD_ALLOWEDNAMESPACE: case FIELD_ALLOWEDNAMESPACES: return (T) getAllowedNamespaces(); case FIELD_SCM: return (T) getScm(); case FIELD_REPOSITORIES: return (T) getRepositories(); case FIELD_PROPERTIES: return (T) getProperties(); default: return getProperty(fieldName); } }
AbstractExtension implements MutableExtension { @Override public <T> T get(String fieldName) { switch (fieldName.toLowerCase()) { case FIELD_REPOSITORY: return (T) getRepository(); case FIELD_ID: return (T) getId().getId(); case FIELD_VERSION: return (T) getId().getVersion(); case FIELD_FEATURE: case FIELD_FEATURES: return (T) ExtensionIdConverter.toStringList(getExtensionFeatures()); case FIELD_EXTENSIONFEATURE: case FIELD_EXTENSIONFEATURES: return (T) getExtensionFeatures(); case FIELD_SUMMARY: return (T) getSummary(); case FIELD_DESCRIPTION: return (T) getDescription(); case FIELD_AUTHOR: case FIELD_AUTHORS: return (T) getAuthors(); case FIELD_CATEGORY: return (T) getCategory(); case FIELD_LICENSE: case FIELD_LICENSES: return (T) getLicenses(); case FIELD_NAME: return (T) getName(); case FIELD_TYPE: return (T) getType(); case FIELD_WEBSITE: return (T) getWebSite(); case FIELD_NAMESPACES: case FIELD_ALLOWEDNAMESPACE: case FIELD_ALLOWEDNAMESPACES: return (T) getAllowedNamespaces(); case FIELD_SCM: return (T) getScm(); case FIELD_REPOSITORIES: return (T) getRepositories(); case FIELD_PROPERTIES: return (T) getProperties(); default: return getProperty(fieldName); } } }
AbstractExtension implements MutableExtension { @Override public <T> T get(String fieldName) { switch (fieldName.toLowerCase()) { case FIELD_REPOSITORY: return (T) getRepository(); case FIELD_ID: return (T) getId().getId(); case FIELD_VERSION: return (T) getId().getVersion(); case FIELD_FEATURE: case FIELD_FEATURES: return (T) ExtensionIdConverter.toStringList(getExtensionFeatures()); case FIELD_EXTENSIONFEATURE: case FIELD_EXTENSIONFEATURES: return (T) getExtensionFeatures(); case FIELD_SUMMARY: return (T) getSummary(); case FIELD_DESCRIPTION: return (T) getDescription(); case FIELD_AUTHOR: case FIELD_AUTHORS: return (T) getAuthors(); case FIELD_CATEGORY: return (T) getCategory(); case FIELD_LICENSE: case FIELD_LICENSES: return (T) getLicenses(); case FIELD_NAME: return (T) getName(); case FIELD_TYPE: return (T) getType(); case FIELD_WEBSITE: return (T) getWebSite(); case FIELD_NAMESPACES: case FIELD_ALLOWEDNAMESPACE: case FIELD_ALLOWEDNAMESPACES: return (T) getAllowedNamespaces(); case FIELD_SCM: return (T) getScm(); case FIELD_REPOSITORIES: return (T) getRepositories(); case FIELD_PROPERTIES: return (T) getProperties(); default: return getProperty(fieldName); } } AbstractExtension(ExtensionRepository repository, ExtensionId id, String type);  AbstractExtension(ExtensionRepository repository, Extension extension); }
AbstractExtension implements MutableExtension { @Override public <T> T get(String fieldName) { switch (fieldName.toLowerCase()) { case FIELD_REPOSITORY: return (T) getRepository(); case FIELD_ID: return (T) getId().getId(); case FIELD_VERSION: return (T) getId().getVersion(); case FIELD_FEATURE: case FIELD_FEATURES: return (T) ExtensionIdConverter.toStringList(getExtensionFeatures()); case FIELD_EXTENSIONFEATURE: case FIELD_EXTENSIONFEATURES: return (T) getExtensionFeatures(); case FIELD_SUMMARY: return (T) getSummary(); case FIELD_DESCRIPTION: return (T) getDescription(); case FIELD_AUTHOR: case FIELD_AUTHORS: return (T) getAuthors(); case FIELD_CATEGORY: return (T) getCategory(); case FIELD_LICENSE: case FIELD_LICENSES: return (T) getLicenses(); case FIELD_NAME: return (T) getName(); case FIELD_TYPE: return (T) getType(); case FIELD_WEBSITE: return (T) getWebSite(); case FIELD_NAMESPACES: case FIELD_ALLOWEDNAMESPACE: case FIELD_ALLOWEDNAMESPACES: return (T) getAllowedNamespaces(); case FIELD_SCM: return (T) getScm(); case FIELD_REPOSITORIES: return (T) getRepositories(); case FIELD_PROPERTIES: return (T) getProperties(); default: return getProperty(fieldName); } } 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 <T> T get(String fieldName) { switch (fieldName.toLowerCase()) { case FIELD_REPOSITORY: return (T) getRepository(); case FIELD_ID: return (T) getId().getId(); case FIELD_VERSION: return (T) getId().getVersion(); case FIELD_FEATURE: case FIELD_FEATURES: return (T) ExtensionIdConverter.toStringList(getExtensionFeatures()); case FIELD_EXTENSIONFEATURE: case FIELD_EXTENSIONFEATURES: return (T) getExtensionFeatures(); case FIELD_SUMMARY: return (T) getSummary(); case FIELD_DESCRIPTION: return (T) getDescription(); case FIELD_AUTHOR: case FIELD_AUTHORS: return (T) getAuthors(); case FIELD_CATEGORY: return (T) getCategory(); case FIELD_LICENSE: case FIELD_LICENSES: return (T) getLicenses(); case FIELD_NAME: return (T) getName(); case FIELD_TYPE: return (T) getType(); case FIELD_WEBSITE: return (T) getWebSite(); case FIELD_NAMESPACES: case FIELD_ALLOWEDNAMESPACE: case FIELD_ALLOWEDNAMESPACES: return (T) getAllowedNamespaces(); case FIELD_SCM: return (T) getScm(); case FIELD_REPOSITORIES: return (T) getRepositories(); case FIELD_PROPERTIES: return (T) getProperties(); default: return getProperty(fieldName); } } 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);  }