0
I have a list in JSON:
{"_status":"sucesso","_dados":{"situacao":"PROCESSADO","mensagem":"Consulta realizada com sucesso","processados":0,"titulos":[],"titulosNaoConciliados":[{"Ocorrencias":[],"CodigosOcorrencias":[],"CodigoMovimento":"06","TituloNossoNumero":"162023418","TituloNossoNumeroOriginal":"2341","TituloDataVencimento":null,"PagamentoValorPago":"74","PagamentoValorCredito":"0,00","PagamentoValorTaxaCobranca":"0,00","PagamentoValorAcrescimos":"0,00","PagamentoData":"16/06/2016","PagamentoDataCredito":"17/06/2016","PagamentoRealizado":true,"TituloNumeroDocumento":""},{"Ocorrencias":[],"CodigosOcorrencias":[],"CodigoMovimento":"28","TituloNossoNumero":"162023418","TituloNossoNumeroOriginal":"2341","TituloDataVencimento":null,"PagamentoValorPago":"74","PagamentoValorCredito":"0,00","PagamentoValorTaxaCobranca":"1,8","PagamentoValorAcrescimos":"0,00","PagamentoData":"16/06/2016","PagamentoDataCredito":"16/06/2016","PagamentoRealizado":false,"TituloNumeroDocumento":""},{"Ocorrencias":[],"CodigosOcorrencias":[],"CodigoMovimento":"06","TituloNossoNumero":"162025348","TituloNossoNumeroOriginal":"2534","TituloDataVencimento":null,"PagamentoValorPago":"100","PagamentoValorCredito":"0,00","PagamentoValorTaxaCobranca":"0,00","PagamentoValorAcrescimos":"0,00","PagamentoData":"16/06/2016","PagamentoDataCredito":"17/06/2016","PagamentoRealizado":true,"TituloNumeroDocumento":""},{"Ocorrencias":[],"CodigosOcorrencias":[],"CodigoMovimento":"28","TituloNossoNumero":"162025348","TituloNossoNumeroOriginal":"2534","TituloDataVencimento":null,"PagamentoValorPago":"100","PagamentoValorCredito":"0,00","PagamentoValorTaxaCobranca":"1,8","PagamentoValorAcrescimos":"0,00","PagamentoData":"16/06/2016","PagamentoDataCredito":"16/06/2016","PagamentoRealizado":false,"TituloNumeroDocumento":""},{"Ocorrencias":[],"CodigosOcorrencias":[],"CodigoMovimento":"06","TituloNossoNumero":"162026735","TituloNossoNumeroOriginal":"2673","TituloDataVencimento":null,"PagamentoValorPago":"21,13","PagamentoValorCredito":"0,00","PagamentoValorTaxaCobranca":"0,00","PagamentoValorAcrescimos":"0,00","PagamentoData":"16/06/2016","PagamentoDataCredito":"17/06/2016","PagamentoRealizado":true,"TituloNumeroDocumento":""},{"Ocorrencias":[],"CodigosOcorrencias":[],"CodigoMovimento":"28","TituloNossoNumero":"162026735","TituloNossoNumeroOriginal":"2673","TituloDataVencimento":null,"PagamentoValorPago":"21,13","PagamentoValorCredito":"0,00","PagamentoValorTaxaCobranca":"1,8","PagamentoValorAcrescimos":"0,00","PagamentoData":"16/06/2016","PagamentoDataCredito":"16/06/2016","PagamentoRealizado":false,"TituloNumeroDocumento":""}]}}
I need to get this list and get only the data:
- Title: 162023418
- Payment Made": true
And add to a list.
Could anyone help? I don’t even know where to start.
Friend thanks for the reply, but I am using java web, I tried to adapt more I could not
– Leandro Santos
@Leandrosantos The main code must work inside a Servlet or inside any other method. You may not want to read from a file, but this code mounts Json directly from a String that you can pick up anywhere. It mounts a
List<PagamentoRealizado>that you can pass to wherever you want, theSystem.out.printlnat the end is just to show that works.– Victor Stafusa
@Leandrosantos I separated the method
pagamentosDoJsonof the rest of themainto facilitate the task of adapting the code to where you need it.– Victor Stafusa
to yes, what would be the title -> ?
– Leandro Santos
@Leandrosantos It is the declaration of a lambda, a feature of the Java language introduced in Java 8.
– Victor Stafusa
I’m getting an error on this line
– Leandro Santos
@Leandrosantos What error? What is your version of Java?
– Victor Stafusa
Let’s go continue this discussion in chat.
– Leandro Santos