//
// https://www.ramecera.it/myscrewdriver.html
// e-mail: screwdriver@ramecera.it
//
/* This program and the accompanying materials are made available under
 * the terms of the Eclipse Public License v1.0 which accompanies this
 * distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html */
package it.ramecera.screwdriver.outfits;

import it.ramecera.salad.everyday.Mix;
import it.ramecera.screwdriver.Wagon;

/**
 * <p>
 * Elements forming a quartz trigger.
 * </p>
 * <p>
 * Company: Ramecera™<br>
 * Creation date: 2020-04-09<br>
 * Last updated: 2020-04-09
 * </p>
 * <p>
 * Modifications:<br>
 * </p>
 * 
 * @author M. Maglioni */
final public class ClockHands {

	/** elements of a simple trigger */
	public String simple;
	/** elements of a cron trigger */
	public String cron;
	/** job name, with one or more triggers */
	public String jobName;
	/** capitalized job name */
	public String jobNameU;
	/** task name, with one or more triggers */
	public String taskName;
	/** capitalized job name */
	public String taskNameU;
	/** rail number where the DB quartz tables are placed */
	public int rail;

	/** default constructor */
	public ClockHands() {

	}

	/**
	 * <p>
	 * Classic constructor.
	 * </p>
	 * <p>
	 * Creation date: 2020-04-09<br>
	 * Last updated: 2020-04-09
	 * </p>
	 * <p>
	 * Modifications:<br>
	 * </p>
	 * 
	 * @param simpleV elements of a simple trigger
	 * @param cronV elements of a cron trigger
	 * @param jobNameV name of the job
	 * @param taskNameV name of the task
	 * @param railV rail where the DB tables for quartz are placed */
	public ClockHands(Wagon simpleV, Wagon cronV, Wagon jobNameV,
			Wagon taskNameV, Wagon railV) {
		super();
		if (simpleV != null) {
			this.simple = simpleV.text.trim();
		}
		if (cronV != null) {
			this.cron = cronV.text.trim();
		}
		if (jobNameV != null) {
			this.jobName = jobNameV.text.trim();
			this.taskName = taskNameV.text.trim();
			this.jobNameU = Mix.uppercaseFirstChar(this.jobName);
			this.taskNameU = Mix.uppercaseFirstChar(this.taskName);
		}
		if (railV.text.matches("d+")) {
			this.rail = Integer.valueOf(railV.text);
		}
	}

}
