Interface HasImplements<T extends HasImplements<T>>

  • Type Parameters:
    T - the extending type
    All Known Subinterfaces:
    Class, ClassOrInterface<T>, Enum, Interface

    public interface HasImplements<T extends HasImplements<T>>
    A trait for models that have interfaces as supertypes.
    Since:
    2.0
    Author:
    Emil Forslund
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default T add​(Type interf)
      Adds the specified interface to the list of implemented interfaces of this model.
      List<Type> getInterfaces()
      Returns a list of all the interfaces implemented by this model.
      default T implement​(Type interf)
      Adds the specified interface to the list of implemented interfaces of this model.
      default T implement​(Type interf, Type... params)
      Adds the specified interface to the list of implemented interfaces of this model.
      default T implement​(Type interf, String... params)
      Adds the specified interface to the list of implemented interfaces of this model.
    • Method Detail

      • add

        default T add​(Type interf)
        Adds the specified interface to the list of implemented interfaces of this model. The type should represent an interface.
        Parameters:
        interf - the implemented interface
        Returns:
        a reference to this
      • implement

        default T implement​(Type interf)
        Adds the specified interface to the list of implemented interfaces of this model. The type should represent an interface. This method is a synonym for add(Type).
        Parameters:
        interf - the implemented interface
        Returns:
        a reference to this
        Since:
        2.5
      • implement

        default T implement​(Type interf,
                            Type... params)
        Adds the specified interface to the list of implemented interfaces of this model. This method will construct a parameterized type with all the specified type parameters as generic arguments. The type should represent an interface.
        Parameters:
        interf - the implemented interface
        params - the generic types of that interface
        Returns:
        a reference to this
        Since:
        2.5
      • implement

        default T implement​(Type interf,
                            String... params)
        Adds the specified interface to the list of implemented interfaces of this model. This method will construct a parameterized type with all the specified type parameters as generic arguments. The type should represent an interface.
        Parameters:
        interf - the implemented interface
        params - the generic types of that interface
        Returns:
        a reference to this
        Since:
        2.5
      • getInterfaces

        List<Type> getInterfaces()
        Returns a list of all the interfaces implemented by this model.

        The list returned must be mutable for changes!

        Returns:
        the interfaces