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
package src.main.java; | |
import java.util.Scanner; | |
/** | |
* {@link RGBColors}. | |
* @author Samuel Catalano | |
*/ | |
public class RGBColors{ | |
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
//javax.ws.rs.core.Response return message error | |
// catch Expection | |
JsonObject error = new JsonObject(); | |
error.put("erro", e.getMessage()); | |
return Response.status(HttpStatus.SC_BAD_REQUEST).entity(error.toString()).type(MediaType.APPLICATION_JSON).build(); |
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
public class ConsumidorBuilder { | |
private Consumidor consumidor; | |
public ConsumidorBuilder() { | |
this.consumidor = new Consumidor(); | |
} | |
public ConsumidorBuilder idExterno(String idExterno) { | |
this.consumidor.setIdExterno(idExterno); |
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
final ObjectMapper mapper = new ObjectMapper(); | |
try { | |
usuario = mapper.writeValueAsString(usuarioRaichu); | |
final Client client = ClientBuilder.newClient(); | |
response = client | |
.target(host) | |
.request().header("Authorization", authToken) | |
.accept(MediaType.APPLICATION_JSON) | |
.post(Entity.entity(usuario, "application/json")); |
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
# custom IntelliJ IDEA VM options | |
-ea | |
-server | |
-Xms2G | |
-Xmx4096M | |
-Xss16m | |
-XX:MaxMetaspaceSize=2G | |
-XX:MetaspaceSize=512m | |
-XX:ConcGCThreads=6 |
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
public static Cache<Integer, List<CountryPublicHolidays>> countryPublicHolidaysCache; | |
static { | |
countryPublicHolidaysCache = CacheBuilder.newBuilder() | |
.maximumSize(1000) | |
.expireAfterWrite(20, TimeUnit.MINUTES) | |
.build(); | |
} | |
var cachedCountryPublicHolidays = countryPublicHolidaysCache.getIfPresent(currentYear); |