public static final TimeUnit getTimeUnit ( int value ) { TimeUnit result = null ; switch ( value ) { case 1 : { // Appears to mean "use the document format" result = TimeUnit . ELAPSED_DAYS ; break ; } case 2 : { result = TimeUnit . HOURS ; break ; } case 4 : { result = TimeUnit . DAYS ; break ; } case 6 : { result = TimeUnit . WEEKS ; break ; } case 8 : case 10 : { result = TimeUnit . MONTHS ; break ; } case 12 : { result = TimeUnit . YEARS ; break ; } default : { break ; } } return result ; }
Convert an integer value into a TimeUnit instance .