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 | 31 |
Tags
- kubernetes
- Stress test
- CRD
- 쿠버네티스
- 익명클래스
- 코틀린
- 동기화
- java
- devops
- Microservice
- 머신러닝
- Algorithm
- 마이크로서비스
- spring microservice
- MySQL
- ansible
- Kotlin
- Spring
- 클라우드 네이티브
- ingress
- cloud native
- 자바
- cloud native java
- Adapter 패턴
- nGrinder
- MSA
- 클라우드 네이티브 자바
- Semaphore
- decorator 패턴
- 헬름
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