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 Details

    • getPermittedTypes

      Set<CtTypeReference<?>> getPermittedTypes()
      Returns the permitted types for this type.
      Returns:
      an unmodifiable view of the permitted types.
    • setPermittedTypes

      CtSealable setPermittedTypes(Collection<CtTypeReference<?>> permittedTypes)
      Sets the permitted types for this type. Calling this method does not change the state of the ModifierKind.SEALED for this type. The previously permitted types will be removed.
      Parameters:
      permittedTypes - the permitted types to set.
      Returns:
      this.
    • addPermittedType

      CtSealable addPermittedType(CtTypeReference<?> type)
      Adds a permitted type to this type. Calling this method does not change the state of the ModifierKind.SEALED for this type.
      Parameters:
      type - the type to add as permitted type.
      Returns:
      this.
    • removePermittedType

      CtSealable removePermittedType(CtTypeReference<?> type)
      Adds a permitted type to this type. Calling this method does not change the state of the ModifierKind.SEALED for this type.
      Parameters:
      type - the type to remove from this type's permitted types.
      Returns:
      this.