spoon.reflect.declaration.CtEnum Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spoon-core Show documentation
Show all versions of spoon-core Show documentation
Spoon is a tool for meta-programming, analysis and transformation of Java programs.
/*
* SPDX-License-Identifier: (MIT OR CECILL-C)
*
* Copyright (C) 2006-2023 INRIA and contributors
*
* Spoon is available either under the terms of the MIT License (see LICENSE-MIT.txt) or the Cecill-C License (see LICENSE-CECILL-C.txt). You as the user are entitled to choose the terms under which to adopt Spoon.
*/
package spoon.reflect.declaration;
import spoon.reflect.reference.CtTypeReference;
import spoon.reflect.annotations.PropertyGetter;
import spoon.reflect.annotations.PropertySetter;
import spoon.support.DerivedProperty;
import spoon.support.UnsettableProperty;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import static spoon.reflect.path.CtRole.VALUE;
/**
* This element represents an enumeration declaration.
*
* Example:
*
* enum Boolean { TRUE, FALSE }
*
*/
public interface CtEnum> extends CtClass {
/**
* Adds an enum value.
*
* @param enumValue
* An enum value.
* @return true if this element changed as a result of the call
*/
@PropertySetter(role = VALUE)
> C addEnumValue(CtEnumValue> enumValue);
/**
* Removes en enum value.
*
* @param enumValue
* An enum value.
* @return true if this element changed as a result of the call
*/
@PropertySetter(role = VALUE)
boolean removeEnumValue(CtEnumValue> enumValue);
/**
* Gets an enum value by its name.
*
* @param name
* Name of the enum value.
* @return An enum value.
*/
@PropertyGetter(role = VALUE)
CtEnumValue> getEnumValue(String name);
/**
* Gets all enum values of the enumeration.
*
* @return All enum values.
*/
@PropertyGetter(role = VALUE)
List> getEnumValues();
/**
*Sets all enum values of the enum.
*/
@PropertySetter(role = VALUE)
> C setEnumValues(List> enumValues);
@Override
CtEnum clone();
@Override
@UnsettableProperty
T setFormalCtTypeParameters(List formalTypeParameters);
@Override
@UnsettableProperty
> C setSuperclass(CtTypeReference> superClass);
@Override
@DerivedProperty
Set> getPermittedTypes();
@Override
@UnsettableProperty
CtEnum setPermittedTypes(Collection> permittedTypes);
@Override
@UnsettableProperty
CtEnum addPermittedType(CtTypeReference> type);
@Override
@UnsettableProperty
CtEnum removePermittedType(CtTypeReference> type);
}