public static Integer getDurationValue ( ProjectProperties properties , Duration duration ) { Integer result ; if ( duration == null ) { result = null ; } else { if ( duration . getUnits ( ) != TimeUnit . MINUTES ) { duration = duration . convertUnits ( TimeUnit . MINUTES , properties ) ; } result = Integer . valueOf ( ( int ) duration . getDuration ( ) ) ; } return ( result ) ; }
Convert an MPXJ Duration instance into an integer duration in minutes ready to be written to an MPX file .