@Test public void ncbiTaxonStripPrefix() { assertThat( ExternalIdUtil.stripPrefix(TaxonomyProvider.NCBI, "NCBI:txid9606"), is("9606") ); }
public static String stripPrefix(TaxonomyProvider provider, String externalId) { String strippedShortest = externalId; for (String idPrefix : provider.getIdPrefixes()) { String stripped = StringUtils.replace(externalId, idPrefix, ""); if (StringUtils.length(stripped) < StringUtils.length(strippedShortest)) { strippedShortest = stripped; } } return StringUtils.trim(strippedShortest); }
ExternalIdUtil { public static String stripPrefix(TaxonomyProvider provider, String externalId) { String strippedShortest = externalId; for (String idPrefix : provider.getIdPrefixes()) { String stripped = StringUtils.replace(externalId, idPrefix, ""); if (StringUtils.length(stripped) < StringUtils.length(strippedShortest)) { strippedShortest = stripped; } } return StringUtils.trim(strippedShortest); } }
ExternalIdUtil { public static String stripPrefix(TaxonomyProvider provider, String externalId) { String strippedShortest = externalId; for (String idPrefix : provider.getIdPrefixes()) { String stripped = StringUtils.replace(externalId, idPrefix, ""); if (StringUtils.length(stripped) < StringUtils.length(strippedShortest)) { strippedShortest = stripped; } } return StringUtils.trim(strippedShortest); }  }
ExternalIdUtil { public static String stripPrefix(TaxonomyProvider provider, String externalId) { String strippedShortest = externalId; for (String idPrefix : provider.getIdPrefixes()) { String stripped = StringUtils.replace(externalId, idPrefix, ""); if (StringUtils.length(stripped) < StringUtils.length(strippedShortest)) { strippedShortest = stripped; } } return StringUtils.trim(strippedShortest); }  static String urlForExternalId(String externalId); static boolean isIRMNG(String idPrefix); static String urlForIRMNG(String externalId, String idPrefix); static Map<String, String> getURLPrefixMap(); static Map<String, String> getURLSuffixMap(); static boolean isSupported(String externalId); static TaxonomyProvider taxonomyProviderFor(String externalId); static String getUrlFromExternalId(String jsonString); static String buildJsonUrl(String url); static String toCitation(String contributor, String description, String publicationYear); static String selectValue(Map<String, String> link, String[] candidateIdsInIncreasingPreference); static boolean hasProperty(Map<String, String> link, String propertyName); static String stripPrefix(TaxonomyProvider provider, String externalId); static String prefixForUrl(String url); static boolean isLikelyId(String idCandidate); static boolean isUnlikelyId(String idCandidate); }
ExternalIdUtil { public static String stripPrefix(TaxonomyProvider provider, String externalId) { String strippedShortest = externalId; for (String idPrefix : provider.getIdPrefixes()) { String stripped = StringUtils.replace(externalId, idPrefix, ""); if (StringUtils.length(stripped) < StringUtils.length(strippedShortest)) { strippedShortest = stripped; } } return StringUtils.trim(strippedShortest); }  static String urlForExternalId(String externalId); static boolean isIRMNG(String idPrefix); static String urlForIRMNG(String externalId, String idPrefix); static Map<String, String> getURLPrefixMap(); static Map<String, String> getURLSuffixMap(); static boolean isSupported(String externalId); static TaxonomyProvider taxonomyProviderFor(String externalId); static String getUrlFromExternalId(String jsonString); static String buildJsonUrl(String url); static String toCitation(String contributor, String description, String publicationYear); static String selectValue(Map<String, String> link, String[] candidateIdsInIncreasingPreference); static boolean hasProperty(Map<String, String> link, String propertyName); static String stripPrefix(TaxonomyProvider provider, String externalId); static String prefixForUrl(String url); static boolean isLikelyId(String idCandidate); static boolean isUnlikelyId(String idCandidate);  }