Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package com.simprints.infra.config.store.models

import java.io.Serializable

data class AgeGroup(
val startInclusive: Int,
val endExclusive: Int?,
) {
fun isEmpty(): Boolean =
startInclusive == 0 && (endExclusive == null || endExclusive == 0)
) : Serializable {
fun isEmpty() = startInclusive == 0 && (endExclusive == null || endExclusive == 0)

fun includes(age: Int): Boolean {
val endExclusive = endExclusive ?: Int.MAX_VALUE
Expand All @@ -17,4 +18,4 @@ data class AgeGroup(
val otherEndExclusive = otherRange.endExclusive ?: Int.MAX_VALUE
return startInclusive <= otherRange.startInclusive && otherEndExclusive <= thisEndExclusive
}
}
}