<commit_before>package com.github.error418.opennms.client.transfer;

import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;

/**
 * Represents OpenNMS Severity Levels. The severity level Enum JavaDocs are
 * taken from the OpenNMS documentation.
 */
@XmlType(name = "severity")
@XmlEnum
public enum Severity {
	/**
	 * This event means numerous devices on the network are affected by the
	 * event. Everyone who can should stop what they are doing and focus on
	 * fixing the problem.
	 */
	@XmlEnumValue("7") CRITICAL(7),

	/**
	 * A device is completely down or in danger of going down. Attention needs
	 * to be paid to this problem immediately.
	 */
	@XmlEnumValue("6") MAJOR(6),

	/**
	 * A part of a device (a service, and interface, a power supply, etc.) has
	 * stopped functioning. The device needs attention.
	 */
	@XmlEnumValue("5") MINOR(5),

	/**
	 * An event has occurred that may require action. This severity can also be
	 * used to indicate a condition that should be noted (logged) but does not
	 * require direct action.
	 */
	@XmlEnumValue("4") WARNING(4),

	/**
	 * Informational message. No action required.
	 */
	@XmlEnumValue("3") NORMAL(3),

	/**
	 * This severity is reserved for use in Alarms to indicate that an alarm
	 * describes a self-clearing error condition has been corrected and service
	 * is restored. This severity should never be used in event definitions.
	 * 
	 * Please use "Normal" severity for events that clear an alarm.
	 */
	@XmlEnumValue("2") CLEARED(2),

	/**
	 * No Severity could be associated with this event.
	 */
	@XmlEnumValue("1") INDETERMINATE(1);

	private int severityValue;

	Severity(int severityValue) {
		this.severityValue = severityValue;
	}

	/**
	 * Gets the level value of the Enum
	 * 
	 * @return OpenNMS level identifier
	 */
	public int value() {
		return this.severityValue;
	}
}<commit_msg>get Severity enums by value<commit_after>package com.github.error418.opennms.client.transfer;

import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;

/**
 * Represents OpenNMS Severity Levels. The severity level Enum JavaDocs are
 * taken from the OpenNMS documentation.
 */
@XmlType(name = "severity")
@XmlEnum
public enum Severity {
	/**
	 * This event means numerous devices on the network are affected by the
	 * event. Everyone who can should stop what they are doing and focus on
	 * fixing the problem.
	 */
	@XmlEnumValue("7") CRITICAL(7),

	/**
	 * A device is completely down or in danger of going down. Attention needs
	 * to be paid to this problem immediately.
	 */
	@XmlEnumValue("6") MAJOR(6),

	/**
	 * A part of a device (a service, and interface, a power supply, etc.) has
	 * stopped functioning. The device needs attention.
	 */
	@XmlEnumValue("5") MINOR(5),

	/**
	 * An event has occurred that may require action. This severity can also be
	 * used to indicate a condition that should be noted (logged) but does not
	 * require direct action.
	 */
	@XmlEnumValue("4") WARNING(4),

	/**
	 * Informational message. No action required.
	 */
	@XmlEnumValue("3") NORMAL(3),

	/**
	 * This severity is reserved for use in Alarms to indicate that an alarm
	 * describes a self-clearing error condition has been corrected and service
	 * is restored. This severity should never be used in event definitions.
	 * 
	 * Please use "Normal" severity for events that clear an alarm.
	 */
	@XmlEnumValue("2") CLEARED(2),

	/**
	 * No Severity could be associated with this event.
	 */
	@XmlEnumValue("1") INDETERMINATE(1);

	private int severityValue;

	Severity(int severityValue) {
		this.severityValue = severityValue;
	}

	/**
	 * Gets the level value of the Enum
	 * 
	 * @return OpenNMS level identifier
	 */
	public int value() {
		return this.severityValue;
	}
	
	/**
	 * Returns the Severity enum, which is associated with the given value.
	 * 
	 * @param value severity value to search for
	 * @return null, if no severity is assigned to the given value; otherwise the assigned Severity enum.
	 */
	public Severity getSeverity(int value) {
		for(Severity severity : Severity.values()) {
			if (severity.value() == value) {
				return severity;
			}
		}
		
		return null;
	}
}
{'fraction_non_alphanumeric': 0.10090466249130133, 'fraction_numerical': 0.007886801206216655, 'mean_word_length': 3.5677966101694913, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '983623', 'n_tokens_mistral': 1376, 'n_tokens_neox': 1238, 'n_words': 492}