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

com.webcodepro.shrinkit.ThreadClass Maven / Gradle / Ivy

package com.webcodepro.shrinkit;

/**
 * Define and decode the thread_class field.
 * @author [email protected]
 */
public enum ThreadClass {
	MESSAGE, CONTROL, DATA, FILENAME;

	/**
	 * Find the given ThreadClass.
	 * @throws IllegalArgumentException if the thread_class is unknown
	 */
	public static ThreadClass find(int threadClass) {
		switch (threadClass) {
		case 0x0000: return MESSAGE;
		case 0x0001: return CONTROL;
		case 0x0002: return DATA;
		case 0x0003: return FILENAME;
		default:
			throw new IllegalArgumentException("Unknown thread_class of " + threadClass);
		}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy