Mastering Kotlin by Nate Ebel

Mastering Kotlin by Nate Ebel

Author:Nate Ebel
Language: eng
Format: epub
Tags: COM051280 - COMPUTERS / Programming Languages / Java, COM060160 - COMPUTERS / Web / Web Programming, COM051460 - COMPUTERS / Programming / Mobile Devices
Publisher: Packt Publishing
Published: 2019-10-11T11:43:22+00:00


@ColorRes

public final int getResId() {

return this.resId;

}

public ViewModel(int resId) {

this.resId = resId;

}

}

We can also specify multiple use-site targets if we want to add the annotation to multiple generated elements:

class ViewModel( @get:ColorRes @param:ColorRes val resId:Int )

In this case, the getter and the constructor parameter will both have the ColorRes annotation applied to them in the generated code:

public final class ViewModel {

private final int resId;

@ColorRes

public final int getResId() {

return this.resId;

}



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.