ErrorCodes.java

/**
 * TFG 75.678 - TFG Desarrollo web 2020 e-Learning for Schools
 * Copyright (C) 2020  Eduardo Rodriguez Carro
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.uoc.tfg.sel.web.model;

import com.fasterxml.jackson.annotation.JsonValue;

/**
 * Enumeracion de codigos de error para tener un catalogo de errores para poder
 * ser capturados por el cliente si es necesario.
 *
 * @author Eduardo Rodriguez Carro
 */
public enum ErrorCodes {
	
	/** The unknown. */
	UNKNOWN(0),
	
	/** The datainconsistent. */
	DATAINCONSISTENT(1000),
	
	/** The headerrequired. */
	HEADERREQUIRED(1100),
	
	/** The notallowed. */
	NOTALLOWED(2000),
	
	/** The validation. */
	VALIDATION(5000),
	
	/** The validation nostudents. */
	VALIDATION_NOSTUDENTS(50001)
	;
	
	
	/** The number. */
	private final int number;

    /**
	 * Instantiates a new error codes.
	 *
	 * @param number the number
	 */
    private ErrorCodes(int number) {
        this.number = number;
    }

    /**
	 * Usar este valor al exportar a JSON.
	 *
	 * @return the number
	 */
    @JsonValue
    public int getNumber() {
        return number;
    }
    
}