Package spoon.reflect.declaration
Interface CtSealable
- All Known Subinterfaces:
CtClass<T>
,CtEnum<T>
,CtInterface<T>
,CtRecord
- All Known Implementing Classes:
CtClassImpl
,CtEnumImpl
,CtInterfaceImpl
,CtRecordImpl
public interface CtSealable
This interface represents any type that can be sealed.
See JLS 8.1.1.2
-
Method Summary
Modifier and TypeMethodDescriptionaddPermittedType(CtTypeReference<?> type)
Adds a permitted type to this type.Set<CtTypeReference<?>>
Returns the permitted types for this type.removePermittedType(CtTypeReference<?> type)
Adds a permitted type to this type.setPermittedTypes(Collection<CtTypeReference<?>> permittedTypes)
Sets the permitted types for this type.
-
Method Details
-
getPermittedTypes
Set<CtTypeReference<?>> getPermittedTypes()Returns the permitted types for this type.- Returns:
- an unmodifiable view of the permitted types.
-
setPermittedTypes
Sets the permitted types for this type. Calling this method does not change the state of theModifierKind.SEALED
for this type. The previously permitted types will be removed.- Parameters:
permittedTypes
- the permitted types to set.- Returns:
- this.
-
addPermittedType
Adds a permitted type to this type. Calling this method does not change the state of theModifierKind.SEALED
for this type.- Parameters:
type
- the type to add as permitted type.- Returns:
- this.
-
removePermittedType
Adds a permitted type to this type. Calling this method does not change the state of theModifierKind.SEALED
for this type.- Parameters:
type
- the type to remove from this type's permitted types.- Returns:
- this.
-