kschlesselmann
05/24/2017, 4:00 PM@Embeddable
data class RouterId(val routerId: String) {
init {
val octets = routerId.split(":")
if (octets.size != 6) {
throw IllegalArgumentException("$routerId does not consist of 6 octets")
}
for (octet in octets) {
Integer.parseInt(octet, 16)
}
}
private constructor() : this("11:11:11:11:11:11")
}
I think my default value in the private constructor is not so nice 😕