All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.cassproject.schema.cass.competency.Level Maven / Gradle / Ivy

There is a newer version: 3.1.8
Show newest version
package org.cassproject.schema.cass.competency;

import org.cassproject.schema.cass.Cass;
import org.schema.CreativeWork;
import org.stjs.javascript.Array;
import org.stjs.javascript.JSObjectAdapter;
import org.stjs.javascript.Map;

/**
 * When an individual's performance in a competency can be measured, a level specifies milestones that an individual can reach, creating fine-grained distinction between the proficient and the adept.
 *
 * @author [email protected]
 * @class Level
 * @module org.cassproject
 * @extends CreativeWork
 */
public class Level extends CreativeWork {
	private static final String TYPE_0_1 = "http://schema.eduworks.com/cass/0.1/level";
	private static final String TYPE_0_2 = "http://schema.eduworks.com/cass/0.2/level";
	private static final String TYPE_0_3 = "http://schema.cassproject.org/0.2/Level";
	private static final String TYPE_0_4 = "http://schema.cassproject.org/0.3/Level";
	private static final String TYPE_0_5 = "https://schema.cassproject.org/0.3/Level";
	private static final String TYPE_0_6 = "https://schema.cassproject.org/0.4/Level";
	public static final String myType = TYPE_0_6;
	/**
	 * Specifies the URL of the competency this level relates to.
	 *
	 * @property competency
	 * @type string(URL)
	 */
	public String competency;
	/**
	 * The title that one who holds this performance level may assume.
	 *
	 * @property title
	 * @type string
	 */
	public String title;
	/**
	 * The performance characteristics required by this level in text form.
	 * FR - Represented by description.
	 *
	 * @property performance
	 * @type string
	 */
	@Deprecated
	public String performance;
	public Level() {
		setContextAndType(Cass.context, myType);
	}

	@Override
	protected void upgrade() {
		super.upgrade();
		if (TYPE_0_1.equals(type)) {
			Map me = JSObjectAdapter.$properties(this);
			// Error in older versions of LD objects: We used @schema instead of
			// @context. Whoops.
			if (me.$get("@context") == null && me.$get("@schema") != null)
				me.$put("@context", me.$get("@schema"));
			setContextAndType(Cass.context_0_2, TYPE_0_2);
		}
		if (TYPE_0_2.equals(getFullType())) {
			setContextAndType(Cass.context_0_3, TYPE_0_3);
		}
		if (TYPE_0_3.equals(getFullType())) {
			setContextAndType(Cass.context_0_4, TYPE_0_4);
		}
		if (TYPE_0_4.equals(getFullType())) {
			setContextAndType(Cass.context_0_5, TYPE_0_5);
		}
		if (TYPE_0_5.equals(getFullType())) {
			setContextAndType(Cass.context_0_6, TYPE_0_6);
		}
	}

	@Override
	public Array getTypes() {
		Array a = new Array();
		a.push(TYPE_0_6);
		a.push(TYPE_0_5);
		a.push(TYPE_0_4);
		a.push(TYPE_0_3);
		a.push(TYPE_0_2);
		a.push(TYPE_0_1);
		return a;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy