title: Set value of a field without calling set method - Kotlin
body: <p>I've been using Kotlin to develop some apps in Android and what i want to do currently is to set a field value inside the defining class without calling the setter method.</p>
  
  <p>Here is the code inside my class:</p>
  
  <pre><code>var projectList: List&lt;Project&gt;? = null
      set(value) {
          saveProjects(value as ArrayList&lt;Project&gt;)
          field = value
      }
  
  //GO to the database and retrieve list of projects
  fun loadProjects(callback: Project.OnProjectsLoadedListener) {
     database.projectDao().getAll().subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
              .subscribe(
  
                      { success -&gt;
                          callback.onProjectsLoaded(success)
                      //Here i don't want to save the projects, because i've loaded them from the database
                          this.projectList = success
                      },
                      { error -&gt; GenericErrorHandler.handleError(error,callback.retrieveContext())}
  
                      )
  }
  </code></pre>
  
  <p>Does anybody know a way to do this without calling the <code>set(value)</code> method?</p>