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
- K8s
- Spring JPA
- AWS
- spring kafka
- bean
- git
- spring
- JPA
- API
- CodePipeline
- QueryDSL
- ECS
- cd
- Entity
- topic생성
- Kubernetes
- centos7
- Spring Data JPA
- mysql
- entity graph
- mirror maker2
- producer
- consumer
- kafka
- CI
- Streams
- transactionaleventlistener
- PAGING
- offsetdatetime
- Kotlin
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