26 lines
572 B
Python
26 lines
572 B
Python
class SelectorClause:
|
|
"""
|
|
Enum for selector clauses with integer value mapping
|
|
"""
|
|
CLAUSE_UNSPECIFIED = 0
|
|
SAME = 1
|
|
DISTINCT = 2
|
|
|
|
_value_map = {
|
|
0: CLAUSE_UNSPECIFIED,
|
|
1: SAME,
|
|
2: DISTINCT
|
|
}
|
|
|
|
@classmethod
|
|
def get(cls, value: int) -> 'SelectorClause':
|
|
"""
|
|
Get enum instance by integer value
|
|
|
|
Args:
|
|
value: Integer value of the clause
|
|
|
|
Returns:
|
|
Corresponding SelectorClause instance
|
|
"""
|
|
return cls._value_map.get(value)
|