Interface InterfaceCreator

All Superinterfaces:
AnnotatableCreator, GenericTyped, ModifiableCreator, SimpleTyped, TypeCreator, Typed, TypeParameterizedCreator

public sealed interface InterfaceCreator extends TypeCreator, TypeParameterizedCreator
A creator for an interface type.
  • Method Details

    • extends_

      void extends_(GenericType.OfClass genericType)
      Extend a generic interface.
      Parameters:
      genericType - the generic interface type (must not be null)
    • extends_

      void extends_(ClassDesc interface_)
      Extend an interface.
      Parameters:
      interface_ - the descriptor of the interface (must not be null)
    • extends_

      default void extends_(Class<?> interface_)
      Extend an interface.
      Parameters:
      interface_ - the interface (must not be null)
    • defaultMethod

      MethodDesc defaultMethod(String name, Consumer<InstanceMethodCreator> builder)
      Add a default method to the interface. These methods are always public.
      Parameters:
      name - the method name (must not be null)
      builder - the method builder (must not be null)
      Returns:
      the built method's selector for invocation (not null)
    • defaultMethod

      default MethodDesc defaultMethod(String name, MethodTypeDesc type, Consumer<InstanceMethodCreator> builder)
      Add a default method to the interface having the given predefined type. These methods are always public.
      Parameters:
      name - the method name (must not be null)
      type - the method type (must not be null)
      builder - the method builder (must not be null)
      Returns:
      the built method's selector for invocation (not null)
    • defaultMethod

      default MethodDesc defaultMethod(MethodDesc desc, Consumer<InstanceMethodCreator> builder)
      Add a default method to the interface having the same name and type as the given method. These methods are always public.
      Parameters:
      desc - the original method descriptor (must not be null)
      builder - the method builder (must not be null)
      Returns:
      the built method's selector for invocation (not null)
    • privateMethod

      MethodDesc privateMethod(String name, Consumer<InstanceMethodCreator> builder)
      Add a private instance method to the interface.
      Parameters:
      name - the method name (must not be null)
      builder - the method builder (must not be null)
      Returns:
      the built method's selector for invocation (not null)
    • privateMethod

      default MethodDesc privateMethod(String name, MethodTypeDesc type, Consumer<InstanceMethodCreator> builder)
      Add a private method to the interface having the given predefined type.
      Parameters:
      name - the method name (must not be null)
      type - the method type (must not be null)
      builder - the method builder (must not be null)
      Returns:
      the built method's selector for invocation (not null)
    • privateMethod

      default MethodDesc privateMethod(MethodDesc desc, Consumer<InstanceMethodCreator> builder)
      Add a private method to the interface having the same name and type as the given method.
      Parameters:
      desc - the original method descriptor (must not be null)
      builder - the method builder (must not be null)
      Returns:
      the built method's selector for invocation (not null)
    • method

      Add an interface method to the interface. These methods are always public.
      Parameters:
      name - the method name (must not be null)
      builder - the method builder (must not be null)
      Returns:
      the built method's selector for invocation (not null)
    • method

      default MethodDesc method(String name, MethodTypeDesc type, Consumer<AbstractMethodCreator> builder)
      Add an interface method to the interface having the given predefined type. These methods are always public.
      Parameters:
      name - the method name (must not be null)
      type - the method type (must not be null)
      builder - the method builder (must not be null)
      Returns:
      the built method's selector for invocation (not null)
    • method

      default MethodDesc method(MethodDesc desc, Consumer<AbstractMethodCreator> builder)
      Add an interface method to the interface having the same name and type as the given method. These methods are always public.
      Parameters:
      desc - the original method descriptor (must not be null)
      builder - the method builder (must not be null)
      Returns:
      the built method's selector for invocation (not null)