Skip to content

Latest commit

 

History

History

dc-commons-validation

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

DigitalCollections Commons Validation

Commons Validation contains utilities to validate data:

import de.digitalcollections.commons.validation.StringAssertions;
import static de.digitalcollections.commons.validation.StringAssertions.AS_OFTEN_AS;

class Example {
  public boolean validate(String value) {
    StringAssertions input = new StringAssertions("name: 'Alice'");
    return input.doesNotContain("\"")
      && input.contains(":")
      && input.contains("a", AS_OFTEN_AS, "e");
  }  
}