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 |
Tags
- Algorithm
- kubernetes
- Stress test
- ansible
- Microservice
- 클라우드 네이티브 자바
- Spring
- ingress
- 자바
- 익명클래스
- java
- 헬름
- cloud native
- 쿠버네티스
- MySQL
- decorator 패턴
- Kotlin
- devops
- 코틀린
- cloud native java
- 동기화
- 클라우드 네이티브
- 머신러닝
- CRD
- 마이크로서비스
- spring microservice
- Semaphore
- Adapter 패턴
- nGrinder
- MSA
Archives
- Today
- Total
목록takeUnless (1)
카샤의 만개시기
Kotlin takeIf와 takeUnless함수
takeIf 함수 람다식이 true이면 결과값을 반환. public inline fun T.takeIf(predicate: (T) -> Boolean): T? = if (predicate(this)) this else nulltakeUnless 함수 람다식이 false이면 결과값을 반환. public inline fun T.takeIf(predicate: (T) -> Boolean): T? = if (!predicate(this)) this else null예제 val user = "KaSha" val str = "Sha" var index = 0 index = user.indexOf(str).takeIf { it >= 0 } ?: -1 index = user.indexOf(str).takeUnless ..
Kotlin
2019. 12. 8. 04:21