package com.ejie.ad74a.model;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.springframework.context.i18n.LocaleContextHolder;

import com.ejie.ad74a.constantes.Constantes;
import com.ejie.x38.serialization.JsonDateDeserializer;
import com.ejie.x38.serialization.JsonDateSerializer;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

/**
 * MaestroTipoAlarma generated by UDA, 10-jul-2023 9:33:38.
 * 
 * @author UDA
 */

public class MaestroTipoAlarma implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private Long idTipoAlarma48;
	private String descEs48;
	private String descEu48;
	private Date fAlta48;
	private String usuAlta48;
	private Date fModif48;
	private String usuModif48;
	private String desc;
	private List<Alarmas> alarmases = new ArrayList<Alarmas>();

	/**
	 * Method 'MaestroTipoAlarma'.
	 */
	public MaestroTipoAlarma() {
	}

	/**
	 * Method 'MaestroTipoAlarma'.
	 * 
	 * @param idTipoAlarma48 Long
	 */
	public MaestroTipoAlarma(Long idTipoAlarma48) {
		this.idTipoAlarma48 = idTipoAlarma48;
	}

	/**
	 * Method 'MaestroTipoAlarma'.
	 * 
	 * @param idTipoAlarma48 Long
	 * @param descEs48       String
	 * @param descEu48       String
	 * @param fAlta48        Date
	 * @param usuAlta48      String
	 * @param fModif48       Date
	 * @param usuModif48     String
	 */
	public MaestroTipoAlarma(Long idTipoAlarma48, String descEs48, String descEu48, Date fAlta48, String usuAlta48,
			Date fModif48, String usuModif48) {
		this.idTipoAlarma48 = idTipoAlarma48;
		this.descEs48 = descEs48;
		this.descEu48 = descEu48;
		this.fAlta48 = fAlta48;
		this.usuAlta48 = usuAlta48;
		this.fModif48 = fModif48;
		this.usuModif48 = usuModif48;
	}

	/**
	 * Method 'MaestroTipoAlarma'.
	 * 
	 * @param idTipoAlarma48 Long
	 * @param descEs48       String
	 * @param descEu48       String
	 * @param fAlta48        Date
	 * @param usuAlta48      String
	 * @param fModif48       Date
	 * @param usuModif48     String
	 * @param alarmases      List<Alarmas>
	 */
	public MaestroTipoAlarma(Long idTipoAlarma48, String descEs48, String descEu48, Date fAlta48, String usuAlta48,
			Date fModif48, String usuModif48, List<Alarmas> alarmases) {

		this.idTipoAlarma48 = idTipoAlarma48;
		this.descEs48 = descEs48;
		this.descEu48 = descEu48;
		this.fAlta48 = fAlta48;
		this.usuAlta48 = usuAlta48;
		this.fModif48 = fModif48;
		this.usuModif48 = usuModif48;
		this.alarmases = alarmases;
	}

	/**
	 * Method 'getIdTipoAlarma48'.
	 *
	 * @return Long
	 */

	public Long getIdTipoAlarma48() {
		return this.idTipoAlarma48;
	}

	/**
	 * Method 'setIdTipoAlarma48'.
	 *
	 * @param idTipoAlarma48 Long
	 * @return
	 */

	public void setIdTipoAlarma48(Long idTipoAlarma48) {
		this.idTipoAlarma48 = idTipoAlarma48;
	}

	/**
	 * Method 'getDescEs48'.
	 *
	 * @return String
	 */

	public String getDescEs48() {
		return this.descEs48;
	}

	/**
	 * Method 'setDescEs48'.
	 *
	 * @param descEs48 String
	 * @return
	 */

	public void setDescEs48(String descEs48) {
		this.descEs48 = descEs48;
	}

	/**
	 * Method 'getDescEu48'.
	 *
	 * @return String
	 */

	public String getDescEu48() {
		return this.descEu48;
	}

	/**
	 * Method 'setDescEu48'.
	 *
	 * @param descEu48 String
	 * @return
	 */

	public void setDescEu48(String descEu48) {
		this.descEu48 = descEu48;
	}

	/**
	 * Method 'getfAlta48'.
	 *
	 * @return java.util.Date
	 */

	@JsonSerialize(using = JsonDateSerializer.class)
	public Date getfAlta48() {
		return this.fAlta48;
	}

	/**
	 * Method 'setfAlta48'.
	 *
	 * @param fAlta48 java.util.Date
	 * @return
	 */
	@JsonDeserialize(using = JsonDateDeserializer.class)
	public void setfAlta48(Date fAlta48) {
		this.fAlta48 = fAlta48;
	}

	/**
	 * Method 'getUsuAlta48'.
	 *
	 * @return String
	 */

	public String getUsuAlta48() {
		return this.usuAlta48;
	}

	/**
	 * Method 'setUsuAlta48'.
	 *
	 * @param usuAlta48 String
	 * @return
	 */

	public void setUsuAlta48(String usuAlta48) {
		this.usuAlta48 = usuAlta48;
	}

	/**
	 * Method 'getfModif48'.
	 *
	 * @return java.util.Date
	 */

	@JsonSerialize(using = JsonDateSerializer.class)
	public Date getfModif48() {
		return this.fModif48;
	}

	/**
	 * Method 'setfModif48'.
	 *
	 * @param fModif48 java.util.Date
	 * @return
	 */
	@JsonDeserialize(using = JsonDateDeserializer.class)
	public void setfModif48(Date fModif48) {
		this.fModif48 = fModif48;
	}

	/**
	 * Method 'getUsuModif48'.
	 *
	 * @return String
	 */

	public String getUsuModif48() {
		return this.usuModif48;
	}

	/**
	 * Method 'setUsuModif48'.
	 *
	 * @param usuModif48 String
	 * @return
	 */

	public void setUsuModif48(String usuModif48) {
		this.usuModif48 = usuModif48;
	}

	/**
	 * Method 'getAlarmases'.
	 *
	 * @return List
	 */
	@JsonIgnore
	public List<Alarmas> getAlarmases() {
		return this.alarmases;
	}

	/**
	 * Method 'setAlarmases'.
	 *
	 * @param alarmases List
	 * @return
	 */
	public void setAlarmases(List<Alarmas> alarmases) {
		this.alarmases = alarmases;
	}

	/**
	 * Intended only for logging and debugging.
	 * 
	 * Here, the contents of every main field are placed into the result.
	 * 
	 * @return String
	 */
	@Override
	public String toString() {
		StringBuilder result = new StringBuilder();
		result.append(this.getClass().getName()).append(" Object { ");
		result.append(" [ idTipoAlarma48: ").append(this.idTipoAlarma48).append(" ]");
		result.append(", [ descEs48: ").append(this.descEs48).append(" ]");
		result.append(", [ descEu48: ").append(this.descEu48).append(" ]");
		result.append(", [ fAlta48: ").append(this.fAlta48).append(" ]");
		result.append(", [ usuAlta48: ").append(this.usuAlta48).append(" ]");
		result.append(", [ fModif48: ").append(this.fModif48).append(" ]");
		result.append(", [ usuModif48: ").append(this.usuModif48).append(" ]");
		result.append("}");
		return result.toString();
	}

	/**
	 * Method 'getDesc'.
	 *
	 * @return String
	 */
	public String getDesc() {
		if (LocaleContextHolder.getLocale().getLanguage().equalsIgnoreCase(Constantes.LOCALE_ES.getLanguage())) {
			return this.getDescEs48();
		} else if (LocaleContextHolder.getLocale().getLanguage().equalsIgnoreCase(Constantes.LOCALE_EU.getLanguage())) {
			return this.getDescEu48();
		}
		return "";
	}

	/**
	 * Method 'setDesc'.
	 *
	 * @param desct String
	 * @return
	 */
	public void setDesc(String desc) {
		this.desc = desc;
	}
}
