code: public long get(int field)
    {
      switch (field) {
      case TIME:
        return getLocalTime();
  
      case YEAR:
        return getYear();
  
      case MONTH:
        return getMonth();
  
      case DAY_OF_MONTH:
        return getDayOfMonth();
  
      case DAY:
        return getDayOfWeek();
  
      case DAY_OF_WEEK:
        return getDayOfWeek();
  
      case HOUR:
        return getHour();
  
      case MINUTE:
        return getMinute();
  
      case SECOND:
        return getSecond();
  
      case MILLISECOND:
        return getMillisecond();
  
      case TIME_ZONE:
        return getZoneOffset() / 1000;
  
      default:
        return Long.MAX_VALUE;
      }
    }
docs: Gets values based on a field.