package gaf3.core.jpa.query

@Suppress("EnumEntryName")
enum class Comparison {
    eq, ne, lt, lte, gt, gte, like;
    companion object {
        fun isComparison(value: String): Boolean {
            return value.length > 2 && value[0] == '$'
                    && values().any { it.name == value.substring(1) }
        }
        fun fromValue(value: String): Comparison {
            return valueOf(value.substring(1))
        }
    }
}