@Test(expected = IllegalArgumentException.class) public void normalizExeptionTest() { WikidataValidator validator = new WikidataValidator(); validator.normalize("awdawd"); }
@Override public String normalize(String value) { Preconditions.checkNotNull(value, "Identifier value can't be null"); String trimmedValue = value.trim(); Matcher matcher = WIKIDATA_PATTERN.matcher(trimmedValue); if (matcher.matches()) { return value; } throw new IllegalArgumentException(value + " it not a valid Wikidata"); }
WikidataValidator implements IdentifierSchemeValidator { @Override public String normalize(String value) { Preconditions.checkNotNull(value, "Identifier value can't be null"); String trimmedValue = value.trim(); Matcher matcher = WIKIDATA_PATTERN.matcher(trimmedValue); if (matcher.matches()) { return value; } throw new IllegalArgumentException(value + " it not a valid Wikidata"); } }
WikidataValidator implements IdentifierSchemeValidator { @Override public String normalize(String value) { Preconditions.checkNotNull(value, "Identifier value can't be null"); String trimmedValue = value.trim(); Matcher matcher = WIKIDATA_PATTERN.matcher(trimmedValue); if (matcher.matches()) { return value; } throw new IllegalArgumentException(value + " it not a valid Wikidata"); }  }
WikidataValidator implements IdentifierSchemeValidator { @Override public String normalize(String value) { Preconditions.checkNotNull(value, "Identifier value can't be null"); String trimmedValue = value.trim(); Matcher matcher = WIKIDATA_PATTERN.matcher(trimmedValue); if (matcher.matches()) { return value; } throw new IllegalArgumentException(value + " it not a valid Wikidata"); }  @Override boolean isValid(String value); @Override String normalize(String value); }
WikidataValidator implements IdentifierSchemeValidator { @Override public String normalize(String value) { Preconditions.checkNotNull(value, "Identifier value can't be null"); String trimmedValue = value.trim(); Matcher matcher = WIKIDATA_PATTERN.matcher(trimmedValue); if (matcher.matches()) { return value; } throw new IllegalArgumentException(value + " it not a valid Wikidata"); }  @Override boolean isValid(String value); @Override String normalize(String value);  }