/*
* Copyright (c) 2015 Data Harmonisation Panel
*
* All rights reserved. This program and the accompanying materials are made
* available under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution. If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* Data Harmonisation Panel <http://www.dhpanel.eu>
*/
package eu.esdihumboldt.hale.common.schema.model.constraint.property;
import eu.esdihumboldt.hale.common.schema.model.Constraint;
import eu.esdihumboldt.hale.common.schema.model.PropertyConstraint;
import eu.esdihumboldt.hale.common.schema.model.constraint.AbstractFlagConstraint;
/**
* Denotes the property generated auto incremental id
*
* @author Sameer Sheikh
*/
@Constraint(mutable = false)
public class AutoGenerated extends AbstractFlagConstraint implements PropertyConstraint {
/**
* auto incremental is present
*/
public static final AutoGenerated YES = new AutoGenerated(true);
/**
* auto incremental is absent
*/
public static final AutoGenerated NO = new AutoGenerated(false);
/**
* @param flag denoting if auto incremental is available or not
*/
private AutoGenerated(boolean flag) {
super(flag);
}
/**
* constructor
*/
public AutoGenerated() {
super(false);
}
/**
* @param isAutoIncremental flag
* @return auto generated constraint
*/
public static AutoGenerated get(boolean isAutoIncremental) {
return (isAutoIncremental) ? YES : NO;
}
}