melatonina
class ProjectId(value: UUID) : Id(value) { companion object { fun new() = ProjectId(newValue()) } }
Id
@Serializable abstract class Id( @Serializable(with = UUIDSerializer::class) val value: UUID ) { companion object { fun newValue(): UUID = UUID.randomUUID() } override fun hashCode(): Int = value.hashCode() override fun equals(other: Any?): Boolean { if (this === other) return true if (other !is Id) return false if (!this.javaClass.isAssignableFrom(other.javaClass)) return false return (value == other.value) } override fun toString(): String = "${javaClass.simpleName}($value)" }
inline
A modern programming language that makes developers happier.