title: Throwing exception vs returning null value with switch statement
body: <p>So I have function that formats a date to coerce to given enum DateType{CURRENT, START, END} 
  what would be the best way to handling return value with cases that use switch statement</p>
  
  <pre><code>public static String format(Date date, DateType datetype) {
      ..validation checks
  
      switch(datetype){
      case CURRENT:{
          return getFormattedDate(date, "yyyy-MM-dd hh:mm:ss");
      }               
      ... 
       default:throw new ("Something strange happend");
      }
  
  }
  </code></pre>
  
  <p>OR  throw excpetion at the end</p>
  
  <pre><code>   public static String format(Date date, DateType datetype) {
              ..validation checks
  
              switch(datetype){
              case CURRENT:{
                  return getFormattedDate(date, "yyyy-MM-dd hh:mm:ss");
              }               
              ... 
              }
  
                 //It will never reach here, just to make compiler happy 
          throw new IllegalArgumentException("Something strange happend");    
          }
  </code></pre>
  
  <p>OR return null </p>
  
  <pre><code>public static String format(Date date, DateType datetype) {
              ..validation checks
  
              switch(datetype){
              case CURRENT:{
                  return getFormattedDate(date, "yyyy-MM-dd hh:mm:ss");
              }               
              ... 
              }
  
               return null;   
  }
  </code></pre>
  
  <p>What would be the best practice here ? Also all the enum values will be handled in the case statement</p>