Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- kafka
- Spring Data JPA
- git
- offsetdatetime
- Kotlin
- mirror maker2
- centos7
- mysql
- spring kafka
- Entity
- Spring JPA
- topic생성
- API
- Kubernetes
- bean
- cd
- K8s
- CodePipeline
- spring
- entity graph
- QueryDSL
- producer
- consumer
- JPA
- transactionaleventlistener
- ECS
- AWS
- PAGING
- Streams
- CI
Archives
- Today
- Total
목록nullable (1)
Yebali

코틀린에서는 null을 허용하는 nullable 변수가 별도로 존재한다. 이런 변수들을 일일이 if로 체크해서 로직을 하는 것은 아름답지 못할 수 있다. 다른 방법으로 null을 처리하는 방법을 알아보자. Nullable 변수 처리 null을 처리하는 방법은 아래와 같이 몇가지가 있다 ?. (null safe operator) ?: (elvis operator) !!. (non-null assertion operator) ?. (null safe operater) 참조 연산자를 실행하기 전, 객체의 null 여부를 확인부터 하고 null이라면 뒤따라 오는 연산을 실행하지 않는 연산자 fun main() { var a: String? = null println(a?.toUpperCase()) // 'nul..
Kotlin
2021. 9. 22. 22:00