Skip to content

Instantly share code, notes, and snippets.

@gastaldi
Created January 5, 2016 22:10
Show Gist options
  • Save gastaldi/cb0ca88d8373a7a61ed3 to your computer and use it in GitHub Desktop.
Save gastaldi/cb0ca88d8373a7a61ed3 to your computer and use it in GitHub Desktop.
/*
* Copyright 2016 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Eclipse Public License version 1.0, available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.jboss.forge.addon.projects.stacks;
import org.jboss.forge.addon.facets.Facet;
import org.jboss.forge.addon.projects.Project;
import org.jboss.forge.addon.projects.ProjectFacet;
/**
* A {@link StackFacet} represents a set of {@link Facet}s allowed in a project
*
* @author <a href="mailto:[email protected]">George Gastaldi</a>
*/
public interface StackFacet extends ProjectFacet
{
/**
* @return The name of this stack
*/
String getName();
/**
* If this stack supports the installation of this facet.
*
* If the facet is a superclass of a facet supported from this Stack, it will return <code>true</code>.
*
* Example:
* <p/>
* <code>supports(JPAFacet.class) == true</code> if this Stack is the JavaEE 6 stack
* <code>supports(JPAFacet2_1.class) == false</code> if this Stack is the JavaEE 6 stack
*
* @param facet
* @return
*/
boolean supports(Class<? extends Facet<Project>> facet);
/**
* Example:
* <p/>
* <code>matches(JPAFacet2_0.class) == true</code> if this Stack is the JavaEE 6 stack
*/
boolean matches(Class<? extends Facet<Project>> facet);
/**
* Example:
* <p/>
* <code>toSupportedFacet(JPAFacet.class) == JPAFacet2_0.class</code> if this Stack is the JavaEE 6 stack
*/
Class<? extends Facet<Project>> toSupportedFacet(Class<? extends Facet<Project>> facet);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment