Package 

Interface BaseDto


  • 
    public interface BaseDto<Model extends Object>
    
                        

    네트워크와 통신하기 위해 사용되는 DTO를 구조화 합니다. BaseDTO를 사용하기 위해서는 도메인 모델 객체를 별도로 정의해야만 합니다.

    data class MockModel(
        val id: Long,
        val name: String
    )
    
    data class MockDto(
        val id: Long,
        val name: String
    ) : BaseDto<MockModel> {
    
        constructor(model: MockModel) : this(model.id, model.name)
    
        override fun toModel(): MockModel = MockModel(id, name)
    }
    • Method Summary

      Modifier and Type Method Description
      abstract Model toModel() DTO를 Model 객체로 반환합니다.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • toModel

         abstract Model toModel()

        DTO를 Model 객체로 반환합니다.