package com.ejie.ad74a.model;

import java.util.Date;
import java.util.Locale;

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.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

/**
 * MotivosBaja generated by UDA, 23-feb-2023 13:50:30.
 * 
 * @author UDA
 */

public class MotivosBaja implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private Long idMotivoBaja33;
	private String descEs33;
	private String descEu33;
	private String baja33;
	private Date fAlta33;
	private String usuAlta33;

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

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

	/**
	 * Method 'MotivosBaja'.
	 * 
	 * @param idMotivoBaja33 Long
	 * @param descEs33       String
	 * @param descEu33       String
	 * @param fAlta33        Date
	 * @param usuAlta33      String
	 */
	public MotivosBaja(Long idMotivoBaja33, String descEs33, String descEu33, String baja33, Date fAlta33,
			String usuAlta33) {

		this.idMotivoBaja33 = idMotivoBaja33;
		this.descEs33 = descEs33;
		this.descEu33 = descEu33;
		this.baja33 = baja33;
		this.fAlta33 = fAlta33;
		this.usuAlta33 = usuAlta33;
	}

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

	public Long getIdMotivoBaja33() {
		return this.idMotivoBaja33;
	}

	/**
	 * Method 'setIdMotivoBaja33'.
	 *
	 * @param idMotivoBaja33 Long
	 * @return
	 */

	public void setIdMotivoBaja33(Long idMotivoBaja33) {
		this.idMotivoBaja33 = idMotivoBaja33;
	}

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

	public String getDescEs33() {
		return this.descEs33;
	}

	/**
	 * Method 'setDescEs33'.
	 *
	 * @param descEs33 String
	 * @return
	 */

	public void setDescEs33(String descEs33) {
		this.descEs33 = descEs33;
	}

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

	public String getDescEu33() {
		return this.descEu33;
	}

	/**
	 * Method 'setDescEu33'.
	 *
	 * @param descEu33 String
	 * @return
	 */

	public void setDescEu33(String descEu33) {
		this.descEu33 = descEu33;
	}

	/**
	 * Method 'getDesc'.
	 *
	 * @return String
	 */
	public String getDesc() {
		Locale locale = LocaleContextHolder.getLocale();

		if (locale.equals(Constantes.LOCALE_ES)) {
			return this.descEs33;
		} else {
			return this.descEu33;
		}

	}

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

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

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

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

	public String getUsuAlta33() {
		return this.usuAlta33;
	}

	/**
	 * Method 'setUsuAlta33'.
	 *
	 * @param usuAlta33 String
	 * @return
	 */

	public void setUsuAlta33(String usuAlta33) {
		this.usuAlta33 = usuAlta33;
	}

	/**
	 * 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(" [ idMotivoBaja33: ").append(this.idMotivoBaja33).append(" ]");
		result.append(", [ descEs33: ").append(this.descEs33).append(" ]");
		result.append(", [ descEu33: ").append(this.descEu33).append(" ]");
		result.append(", [ baja33: ").append(this.baja33).append(" ]");
		result.append(", [ fAlta33: ").append(this.fAlta33).append(" ]");
		result.append(", [ usuAlta33: ").append(this.usuAlta33).append(" ]");
		result.append("}");
		return result.toString();
	}

	/**
	 * Method 'getBaja33'.
	 *
	 * @return String
	 */
	public String getBaja33() {
		return baja33;
	}

	/**
	 * Method 'setBaja33'.
	 *
	 * @param baja33 String
	 * @return
	 */
	public void setBaja33(String baja33) {
		this.baja33 = baja33;
	}

}
