/*
 * Created on Aug 18, 2008 (C) Copyright TANDBERG Television Ltd.
 */

package com.tandbergtv.watchpoint.pmm.title.validation;

/**
 * @author Vijay Silva
 */
public enum TitleValidationCode {

	/** Indicates a general validation error for the title */
	GENERAL("VAL-TITLE-001"),

	/** Indicates that the specification name was not specified for the title */
	SPEC_UNDEFINED("VAL-TITLE-002"),

	/**
	 * Indicates that the specification name specified is not for a valid specification. Parameters:
	 * <ul>
	 * <li>The invalid specification name</li>
	 * </ul>
	 */
	SPEC_NAME_INVALID("VAL-TITLE-003"),

	/**
	 * Indicates that the root title has a section name different from the name defined in the
	 * specification. Parameters:
	 * <ul>
	 * <li>The Title Name</li>
	 * <li>The Expected Title Name</li>
	 * </ul>
	 */
	TITLE_ROOT_SECTION_NAME_MISMATCH("VAL-TITLE-004"),

	/**
	 * Indicates that the title has a parent title, when the specification indicates that the title
	 * does not have a parent. Parameters:
	 * <ul>
	 * <li>The Title Name</li>
	 * <li>The Parent Title Name</li>
	 * </ul>
	 */
	TITLE_PARENT_INVALID("VAL-TITLE-005"),

	/**
	 * Indicates that the title does not have a parent title, when the specification indicates that
	 * the title has a parent. Parameters:
	 * <ul>
	 * <li>The Title Name</li>
	 * <li>The Expected Parent Title Name</li>
	 * </ul>
	 */
	TITLE_PARENT_MISSING("VAL-TITLE-006"),

	/**
	 * Indicates that the title has a parent title who's name is different from the section name
	 * defined in the specification. Parameters:
	 * <ul>
	 * <li>The Title Name</li>
	 * <li>The Parent Title Name</li>
	 * <li>The Expected Parent Title Name</li>
	 * </ul>
	 */
	TITLE_PARENT_MISMATCH("VAL-TITLE-007"),

	/**
	 * Indicates that a metadata property defined as required by the specification does not have a
	 * value defined. Parameters:
	 * <ul>
	 * <li>Title Section Name</li>
	 * <li>Metadata Property Name</li>
	 * <li>Metadata Property Display Name</li>
	 * </ul>
	 */
	METADATA_REQUIRED_MISSING("VAL-TITLE-008"),

	/**
	 * Indicates that a metadata value does not obey the data type specified in the definition.
	 * Parameters:
	 * <ul>
	 * <li>Title Section Name</li>
	 * <li>Metadata Property Name</li>
	 * <li>Metadata Property Display Name</li>
	 * <li>Data Type</li>
	 * </ul>
	 */
	METADATA_VALUE_DATATYPE_MISMATCH("VAL-TITLE-009"),

	/**
	 * Indicates that a metadata value does not obey the data type specified in the definition.
	 * Parameters:
	 * <ul>
	 * <li>Title Section Name</li>
	 * <li>Metadata Property Name</li>
	 * <li>Metadata Property Display Name</li>
	 * <li>Data Type</li>
	 * <li>Expected Pattern</li>
	 * </ul>
	 */
	METADATA_VALUE_DATATYPE_MISMATCH_WITH_PATTERN("VAL-TITLE-010"),

	/**
	 * Indicates that the title has metadata keys (defined by the specification) that are not unqiue
	 * for the specification.
	 */
	METADATA_KEYS_DUPLICATE("VAL-TITLE-011"),

	/**
	 * Indicates that the External Title defined by the metadata keys provided does not exist in the
	 * external repository
	 */
	EXTERNAL_TITLE_MISSING("VAL-TITLE-012"),

	/**
	 * Indicates that the External Title defined by the metadata keys provided does not uniquely
	 * identify a single title in the external repository. Parameters:
	 * <ul>
	 * <li>Number of matching Titles</li>
	 * </ul>
	 */
	EXTERNAL_TITLE_DUPLICATE("VAL-TITLE-013");

	/* The code string */
	private String code;

	/*
	 * Constructor that takes the validation message code
	 */
	private TitleValidationCode(String code) {
		this.code = code;
	}

	public String getCode() {
		return code;
	}

	/**
	 * Returns the validation message code
	 * 
	 * @see java.lang.Enum#toString()
	 */
	@Override
	public String toString() {
		return code;
	}
}
