from static method

TipLevel from(
  1. int n
)

Implementation

static TipLevel from(int n) {
  return switch (n) {
    0 => error,
    1 => warning,
    2 => info,
    3 => tip,
    _ => throw Exception("Bad TipLevel value "),
  };
}