blob: bd2657f1037f06266ad4e52d71c1dd80353e1766 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2009 Tasktop Technologies and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* https://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*
* Tasktop Technologies - initial API and implementation
*******************************************************************************/
package org.eclipse.mylyn.internal.discovery.core.model;
/**
* A means of specifying that a feature must be present in order for the connectorDescriptor to be presented to the
* user.
*
* @author David Green
*/
public class FeatureFilter {
protected String featureId;
protected String version;
protected ConnectorDescriptor connectorDescriptor;
public FeatureFilter() {
}
/**
* The id of the feature to test
*/
public String getFeatureId() {
return featureId;
}
public void setFeatureId(String featureId) {
this.featureId = featureId;
}
/**
* A version specifier, specified in the same manner as version dependencies are specified in an OSGi manifest. For
* example: "[3.0,4.0)"
*/
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public ConnectorDescriptor getConnectorDescriptor() {
return connectorDescriptor;
}
public void setConnectorDescriptor(ConnectorDescriptor connectorDescriptor) {
this.connectorDescriptor = connectorDescriptor;
}
public void validate() throws ValidationException {
if (featureId == null || featureId.length() == 0) {
throw new ValidationException(Messages.FeatureFilter_must_specify_featureFilter_featureId);
}
if (version == null || version.length() == 0) {
throw new ValidationException(Messages.FeatureFilter_must_specify_featureFilter_version);
}
}
}