Joel Armstrong
04/11/2018, 5:39 PMCzar
04/11/2018, 5:49 PMopen class PublicClassProtectedConstructor protected constructor(/*...*/)
Factory
extends PublicClassProtectedConstructor
to be able to see the constructor 🙂fred.deschenes
04/11/2018, 5:56 PMJoel Armstrong
04/11/2018, 6:03 PMfred.deschenes
04/11/2018, 6:09 PMJoel Armstrong
04/11/2018, 6:13 PMfred.deschenes
04/11/2018, 6:18 PMclass PublicClassProtectedConstructor private constructor(private val bytes: ByteArray) {
companion object Factory {
fun factory1(deviceId: String): PublicClassProtectedConstructor {
val bytes = ByteArray(0) // Setup however
return PublicClassProtectedConstructor(bytes)
}
fun factory2(volume: Int, patch: Int): PublicClassProtectedConstructor {
val bytes = ByteArray(0) // Setup however
return PublicClassProtectedConstructor(bytes)
}
}
}