This file contains hidden or 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 org.apache.commons.lang3.function.Failable; | |
| try { | |
| final List<DadosTransacaoDTO> listaDocumentosProcessados = (List<DadosTransacaoDTO>) SessaoUtils.recuperarAtributoSessao(request, response, AtributosSessao.ATRIBUTO_SESSAO_LISTA_DOCUMENTOS); | |
| final boolean possuiItemConfidencial = Optional.ofNullable(listaDocumentosProcessados) | |
| .orElse(Collections.emptyList()) | |
| .stream() | |
| .flatMap(Failable.asFunction(dados -> DocumentoFacade.obterDocumentosRelacionados(Utilitarios.formatarIdentificador(dados.getNumeroIdentificador())).stream())) | |
| .anyMatch(item -> NivelAcessoDocumento.CONFIDENCIAL.getCodigo().equals(item.getCodigoRestricao())); | |
| JSONObject respostaJson = new JSONObject() |
This file contains hidden or 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
| public class PaymentFactory { | |
| private static final Map<PaymentType, PaymentStrategy> strategies = new EnumMap<>(PaymentType.class); | |
| static { | |
| strategies.put(PaymentType.CREDIT_CARD, new CreditCardPayment()); | |
| strategies.put(PaymentType.DEBIT_CARD, new DebitCardPayment()); | |
| strategies.put(PaymentType.CRYPTO, new CryptoPayment()); | |
| } | |
| public static PaymentStrategy getPaymentStrategy(PaymentType paymentType) { |
This file contains hidden or 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
| DistribuirProtocoloForm distribuirProtocoloForm = (DistribuirProtocoloForm) form; | |
| distribuirProtocoloForm.setAcaoRetorno(ACAO_VOLTAR_ESPECIFICO); | |
| setUcsRetorno(distribuirProtocoloForm, "retornoDistribuirProtocolo", request, response); | |
| ActionRedirect redirect = new ActionRedirect(mapping.findForward("ucsEncaminharProcesso")); | |
| redirect.addParameter("parecerConclusaoEdit", distribuirProtocoloForm.getComplemento()); | |
| Arrays.stream(distribuirProtocoloForm.getListaCod()).forEach(numeroProtocolo -> redirect.addParameter("enclote", numeroProtocolo)); | |
| redirect.setRedirect(false); | |
| return redirect; |
This file contains hidden or 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
| SELECT owner, trigger_name, table_owner, table_name, triggering_event, trigger_body | |
| FROM all_triggers | |
| WHERE table_name = 'NOME_DA_TABELA'; |
This file contains hidden or 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
| @Test | |
| void mockTime() { | |
| LocalDateTime fixed = LocalDateTime.parse("2021-09-29T23:00:00"); | |
| try (MockedStatic<LocalDateTime> b = Mockito.mockStatic(LocalDateTime.class)) { | |
| b.when(LocalDateTime::now).thenReturn(fixed); | |
| System.out.println(LocalDateTime.now()); | |
| }_ | |
| } |
This file contains hidden or 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
| <console-handler name="CONSOLE"> | |
| <level name="TRACE"/> | |
| <formatter> | |
| <named-formatter name="COLOR-PATTERN"/> | |
| </formatter> | |
| </console-handler> | |
| <logger category="org.hibernate.type"> | |
| <level name="TRACE"/> | |
| </logger> |
This file contains hidden or 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
| AnnotationConfiguration hibernateConfiguration = new AnnotationConfiguration() | |
| .configure("hibernate.cfg.xml"); | |
| Dialect dialect = (Dialect) Class.forName(hibernateConfiguration.getProperty("dialect")).newInstance(); | |
| String[] createStatements = hibernateConfiguration.generateSchemaCreationScript(dialect); | |
| Stream<String> statements = Arrays.stream(createStatements); | |
| try (FileOutputStream fos = new FileOutputStream("/home/kauan/sql-create-tables.ddl"); | |
| BufferedWriter out = new BufferedWriter(new OutputStreamWriter(fos));) { |
This file contains hidden or 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
| String str = "joao, maria, fulano"; | |
| List<String> nomes = Arrays.asList(str.split(",")); |
This file contains hidden or 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
| List<String> nomes = new ArrayList<>(Arrays.asList("Kauan", "João", "Maria")); | |
| String nomesSeparadosPorVirgula = StringUtils.join(nomes.toArray(), ","); |
This file contains hidden or 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
| 1.Página JSP | |
| <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> | |
| <%@ taglib uri="http://celepar.pr.gov.br/taglibs/html-2.0" prefix="ch" %> | |
| <%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %> | |
| <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%> | |
| <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%> | |
| <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> | |
| <html:hidden property="indProcessoCarona" name="incluirDistribuicaoItemForm" /> |
NewerOlder