public static Trigger convert2Trigger ( TriggerInfo trig , JobInfo job ) { TriggerBuilder < Trigger > builder = newTrigger ( ) ; builder . withIdentity ( trig . getName ( ) , trig . getGroup ( ) ) ; builder . forJob ( job . getName ( ) , job . getGroup ( ) ) ; switch ( trig . getType ( ) ) { case CRON : setStartEndTime ( trig , builder ) ; if ( ! trig . getCron ( ) . isEmpty ( ) ) builder . withSchedule ( CronScheduleBuilder . cronSchedule ( trig . getCron ( ) ) ) ; break ; case SIMPLE : setStartEndTime ( trig , builder ) ; setCountIntervalValues ( trig , builder ) ; break ; } return builder . build ( ) ; }
Creates an identical Trigger instance from the given annotation .