patternFromBounds<J extends Object> method

String patternFromBounds<J extends Object>(
  1. J upperBound,
  2. J lowerBound
)

Returns the filter pattern for the range type with the provided bounds.

Implementation

String patternFromBounds<J extends Object>(J upperBound, J lowerBound) {
  switch (this) {
    case SupaRangeType.inclusiveInclusive:
      return '[$lowerBound,$upperBound]';
    case SupaRangeType.inclusiveExclusive:
      return '[$lowerBound,$upperBound)';
    case SupaRangeType.exclusiveInclusive:
      return '($lowerBound,$upperBound]';
    case SupaRangeType.exclusiveExclusive:
      return '($lowerBound,$upperBound)';
  }
}