Skip to content

Instantly share code, notes, and snippets.

@handersonbf
Created April 20, 2017 13:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save handersonbf/c14adfbc22a2e3498bb39a5f7126ec0c to your computer and use it in GitHub Desktop.
Save handersonbf/c14adfbc22a2e3498bb39a5f7126ec0c to your computer and use it in GitHub Desktop.
Classe de exemplo de uso de uma Interface Funcional
public class ExecutandoInterfaceFuncional {
public static void main(String[] args) {
String cpf = "09551130401";
Validador validar = new Validador() {
@Override
public boolean validarCPF(String valor) {
return valor.matches("(?!(\\d)\\1{10})\\d{11}");
}
};
Validador validarLambda = (v) -> v.matches("(?!(\\d)\\1{10})\\d{11}") ;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment