package org.kar.karusic.api.UserResourceModel;

import com.fasterxml.jackson.annotation.JsonValue;

public enum PartRight {
	READ(1), //
	WRITE(2), //
	READ_WRITE(3);

	private final int value;

	PartRight(final int value) {
		this.value = value;
	}

	@JsonValue
	public int getValue() {
		return this.value;
	}

	public static PartRight fromValue(final int value) {
		for (final PartRight species : PartRight.values()) {
			if (species.getValue() == value) {
				return species;
			}
		}
		throw new IllegalArgumentException("PartRight: Unknown value: " + value);
	}
}
