Created
November 14, 2018 23:17
-
-
Save andrechavesg/e56a98b6c6959a31b9a24369881662f4 to your computer and use it in GitHub Desktop.
optionals5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Optional; | |
public class Rastreio { | |
public static void main(String[] args) { | |
Buscador buscador = new Buscador(); | |
Optional<Pessoa> pessoaOp = buscador.buscaPorNome("Fabrício de Souza Batista"); | |
pessoaOp.ifPresent(c -> { | |
System.out.println("cpf: "+c.getCpf()); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment