-
-
Save le0nidas/24048dea0578f0f536a4fe88e0ca5cea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// somewhere in the code | |
if (task.status == Status.NotStarted && task.createdAt < LocalDate.of(2021, 1, 14) && task.subscribers.isEmpty()) { | |
task.close() | |
} | |
// which might have led to this API | |
class Task( | |
initialStatus: Status, | |
val createdAt: LocalDate | |
) { | |
var status: Status = initialStatus | |
private set | |
private val innerSubscribers = mutableListOf<Subscriber>() | |
val subscribers: List<Subscriber> = innerSubscribers | |
fun add(subscriber: Subscriber) { | |
innerSubscribers.add(subscriber) | |
} | |
fun close() { | |
status = Status.Resolved | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment