/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * The contents of this file are subject to the terms of the Liferay Enterprise
 * Subscription License ("License"). You may not use this file except in
 * compliance with the License. You can obtain a copy of the License by
 * contacting Liferay, Inc. See the License for the specific language governing
 * permissions and limitations under the License, including but not limited to
 * distribution rights of the Software.
 *
 *
 *
 */

package com.liferay.roles.item.selector;

import com.liferay.portal.kernel.model.role.RoleConstants;
import com.liferay.portal.kernel.util.ArrayUtil;

/**
 * @author Alessio Antonio Rendina
 * @deprecated As of Mueller (7.2.x), , with no direct replacement
 */
@Deprecated
public class RoleItemSelectorCriterion extends BaseRoleItemSelectorCriterion {

	public RoleItemSelectorCriterion() {
	}

	public RoleItemSelectorCriterion(int type) {
		_validateType(type);

		_type = type;
	}

	public int getType() {
		return _type;
	}

	public void setType(int type) {
		_validateType(type);

		_type = type;
	}

	private void _validateType(int type) {
		if (!ArrayUtil.contains(
				RoleConstants.TYPES_ORGANIZATION_AND_REGULAR_AND_SITE, type)) {

			throw new IllegalArgumentException(
				"Role type must have a value of 1, 2, or 3");
		}
	}

	private int _type = RoleConstants.TYPE_REGULAR;

}