title: elegant solution for mapping one string value to another
body: <p>I am working with multiple external systems all of which return a state property.</p>
  
  <p>This state property can be different values between the external systems but must be mapped to a particular state value on my system.</p>
  
  <p>I have a separate class (adapter) to process each external system</p>
  
  <p>e.g</p>
  
  <p>the state values for my system are</p>
  
  <p>{ 
    Pending,
    Booked,
    Arrived,
    InProgress,
    Complete
  }</p>
  
  <p>Now <strong>External System A</strong> may have the following values</p>
  
  <p>{
    Unknown,
    Pending,
    Booked,
    Accepted,
    Arrived,
    POB,
    Complete
  }</p>
  
  <p><strong>External System B</strong> may have the following values</p>
  
  <p>{
    Waiting,
    Booked,
    Arrived,
    InProgress,
    Complete
  }</p>
  
  <p>etc, etc</p>
  
  <p>Now I need to map the external system values to my system values.</p>
  
  <p>eg.</p>
  
  <p>For <strong>External System A</strong></p>
  
  <p>Unknown, Pending -> Pending</p>
  
  <p>Booked, Accepted -> Booked</p>
  
  <p>Arrived, POB -> InProgress</p>
  
  <p>Complete -> Complete</p>
  
  <p>For <strong>External System B</strong></p>
  
  <p>Waiting -> Pending</p>
  
  <p>Booked -> Booked,</p>
  
  <p>Arrived, InProgress -> InProgress</p>
  
  <p>Complete -> Complete</p>
  
  <p>Now I have abstracted this out to a helper method MapState that each adapter uses to get the state value. This method has string parameters externalsystem, and externalsystemstate and uses switch statements to map the external system state to my system state.</p>
  
  <p>I think this is pretty naff and am sure there is a more elegant solution</p>
  
  <p>Any suggestions?</p>