Long-term support (LTS) is a product lifecycle management policy in which a stable release of computer software is maintained for a longer period of time than the standard edition. JAVA8, JAVA11(latest): LTS version JAVA 9, 10: non-LTS version -> 6개월까지만 패치를 지원한다. JAVA9가 나오면서 LTS, non-LTS 버전 정책을 발표했고, JAVA9 부터는 6개월마다 버전을 발표하겠다고 했다. 버전 정책은, JAVA8의 경우 사용량이 높으므로 LTS version이 되었고, 가장 최신 버전인 JAVA11이 현..
데이터 형태가 서버에서 파싱하여 사용하기 좋게 찰떡같이 수신되면 좋겠지만, 그렇지 않은 경우도 많다. 최근 진행하고있는 프로젝트에서 특정 프로토콜 기반으로 통신하기위해서 정해진 포멧으로 JSON을 생성해서 사용해야했는데, 그게 좀 특이한 형태였다. 그래서 데이터를 Map을 해당 프로토콜 기반 JSON 형태로 Serialize하고, 다시 Deserialize 해서 필요한 Object들에 맞게 파싱해주는 작업을 했다. 이 과정에서 주로 사용 및 테스트 했던 어노테이션을 위주로 정리하였으며, 아래 링크를 확인하면 더 많은 어노테이션을 확인 할 수 있다. 참고: https://www.baeldung.com/jackson-annotations Serialization 1. @JsonAnyGetter : Map이 ..
counting: https://stackabuse.com/guide-to-java-8-collectors-counting/ Guide to Java 8 Collectors: counting() In this guide, learn how to count the number of elements in a collection or stream in Java, as well as how to use the Collectors.counting() as a downstream function of other collectors, with examples. stackabuse.com mapping: https://www.javabrahman.com/java-8/java-8-how-to-use-collectors-..
@ReqeustBody나 Jackson을 이용해 Object를 맵핑할 때 어노테이션을 쓰는 경우도 있고, getter/setter로 맵핑되게 구성하는 경우도 있다. 맵핑을 가능하게 하는 케이스들을 알아보자 1. 어노테이션 (getter/setter 없이) @JsonProperty, @JsonAutoDetect 사용 2. ObjectMapper 설정 ObjectMapper objectMapper = new ObjectMapper(); objectMapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY); 3. getter/setter 설정 하지만 이 케이스들을 중복해서 사용할 경우 데이터가 여러개 들어갈 수 있으니 조심해야한다. ..
- Total
- Today
- Yesterday