ApexSensei

Drills Classes & objects

Route Cases with an enum

An enum is a type with a fixed set of named values.

Your task

Route Case priorities with an enum, then loop over every priority with values().

enum CasePriority { LOW, MEDIUM, HIGH }

class PriorityRouter {
    public String route(CasePriority priority) {
        return null;
    }
}

Requirements

  1. .values() should be present
  2. .name() should be present
  3. switch on should be present inside route
  4. Route: LOW to Queue should be built from runtime values
  5. High: Immediate should be printed
  6. Medium: Today should be printed
  7. Priority count: 3 should be printed
  8. The three Route: lines should be printed in order

Sign in to open this drill