일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Spring Data Redis
- netflix
- forkandjoinpool #threadpool #jvm #async #non-blocking
- Eureka
- netflix eureka
- Java
- unittest
- 서비스스펙
- 설계
- docker
- BFS
- code refactoring
- reactive
- java #jvm #reference #gc #strong reference
- test
- unit
- 탐색
- Dynamic Routing
- microservice architecture
- dfs
- spring cloud
- springcloud
- container image #docker #layer #filesystem #content addressable
- api-gateway
- spring cloud netflix eureka
- 단위테스트
- zuul
- spring cloud netflix zuul
- spring cloud netflix
- Today
- Total
phantasmicmeans 기술 블로그
field Keyword name 프로퍼티의 재 정의된 setter를 살펴보면 field 라는 키워드를 볼 수 있다. field에 값을 넣는 것을 보니 무언가 name의 대리자 느낌이 든다. class Test { var name: String = "" set(value) { field = if (value.isNotEmpty()) value else "" } } Backing Fields 코틀린은 Backing Field가 필요하면 알아서 제공한다. 또한 Backing field는 접근자 내에서 field 키워드로 참조할 수 있다. 바로 위 예제에서 setter 내에 field 라고 선언되어진 부분을 볼 수 있는데, 이 field가 Backing Field를 참조하고 있는 상태인 것이다. 그럼 코틀린에..
Kotlin Properties and Fields 코틀린 class의 프로퍼티들은 var or val 키워드로 선언된다. 이 프로퍼티들은 default로 접근자(get, set) method를 포함하기에 코틀린에서의 프로퍼티 란 필드와 접근자를 통칭하는 개념이다. class Address { var name: String = "Holmes, Sherlock" var street: String = "Baker" var city: String = "London" var state: String? = null var zip: String = "123456" } 프로퍼티는 아래와 같이 간단하게 프로퍼티 이름으로 접근할 수 있다. fun copyAddress(address: Address): Address { ..
Class Inheritance kotlin의 최상위 클래스는 Any 클래스에 상위타입을 선언하지 않으면 Any가 상속됨 Any는 java의 Object와 다른 클래스임.. equlas, hashcode, tostring만 있음 class Example1() // 암시적 Any 상속 class Example2() : Any() // 명시적 Any 상속 open open 은 java final과 반대임 open class는 다른 클래스가 상속할 수 있음 기본적으로 kotline의 모든 classs는 final 임 상속 명시적으로 상위타입을 선언하려면, 클래스 헤더의 콜론 뒤에 상위 타입을 선언하면 되며, 부모 클래스는 open keyword 필요 파생 클래스에 primary constructor가 있으면,..
Kotlin Classe 기본 생성자 클래스 헤더의 일부이자 클래스별로 최대 1개만 가질 수 있다. class Person constructor(firstName: String) { } 어노테이션이나 접근지정자가 없을 때는, 기본생성자의 constructor 키워드를 생략가능하다. class Person(firstName: String) { } Primary Constructor 기본생성자는 코드를 가질 수 없으며, 초기화는 초기봐 블록(init) 안에서 작성해야 한다. 기본생성자의 파라미터는 init 블록 안에서 사용 가능 class Customer(name: String) { init { logger.info("customer intialized with value ${name}") } } Secon..
Kotlin Loop Label 기본적으로는 3가지 jume expression이 있다. return: By default returns from the nearest enclosing function or anonymous function. break: Terminates the nearest enclosing loop. continue: Proceeds to the next step of the nearest enclosing loop. Break and Continue Labels Kotlin은 loop에 label을 지정해 break, continue 스코프를 정할 수 있다. label은 @ 식별자를 통해 지정할 수 있고, @abc, fooBar@ 처럼 사용할 수 있다. 아래는 내부 for문에서 ..