How check if a string is a valid UUID in java? If you ask Google, there is a good chance that you’ll get an answer like this:
Yesterday I had a problem with GroupedOpenApi in my Spring Boot 3 project. It seemed like Swagger was completely ignoring it. Swagger was working fine, it used settings provided by OpenAPI bean, but there were no API groups in it.
One day my coworker sent me a code snippet with a simple question “What will be written to the test2 variable?”:
1
2
Boolean test = null;
Boolean test2 = (true) ? test : false;
If you’re working on some feature that includes rotation, and you’re obsessed with a MagicNumber checkstyle rule, most likely you have constants like these in your code:
1
2
public static final short DEGREES_90 = 90;
public static final short DEGREES_180 = 180;
В lombok уже достаточно давно, а так же в самом языке Java начиная с 10 версии существует возможность объявления переменных через var. Это позволяет не указывать тип явно, а позволить компилятору определить его автоматически. Так же, в lombok, Kotlin и Scala (но не в самом Java) есть его “финализированный” собрат val.