Interface HasSupertype<T extends HasSupertype<T>>

  • Type Parameters:
    T - the extending type
    All Known Subinterfaces:
    Class

    public interface HasSupertype<T extends HasSupertype<T>>
    A trait for models that has a super type.
    Since:
    2.0
    Author:
    Emil Forslund
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default T extend​(Type supertype)
      Sets the super type of this model.
      default T extend​(Type supertype, Type... params)
      Sets the super type of this model to a parameterized type created with the specified base type and generic parameters.
      default T extend​(Type supertype, String... params)
      Sets the super type of this model to a parameterized type created with the specified base type and generic parameters.
      Optional<Type> getSupertype()
      Returns the super type if such exists, else empty.
      T setSupertype​(Type type)
      Sets the super type of this model.
    • Method Detail

      • setSupertype

        T setSupertype​(Type type)
        Sets the super type of this model.
        Parameters:
        type - the super type
        Returns:
        a reference to this
      • extend

        default T extend​(Type supertype)
        Sets the super type of this model. This is a synonym for setSupertype(Type).
        Parameters:
        supertype - the super type
        Returns:
        a reference to this
        Since:
        2.5
      • extend

        default T extend​(Type supertype,
                         Type... params)
        Sets the super type of this model to a parameterized type created with the specified base type and generic parameters.
        Parameters:
        supertype - the supertype
        params - the generic types of that supertype
        Returns:
        a reference to this
        Since:
        2.5
      • extend

        default T extend​(Type supertype,
                         String... params)
        Sets the super type of this model to a parameterized type created with the specified base type and generic parameters.
        Parameters:
        supertype - the supertype
        params - the generic types of that supertype
        Returns:
        a reference to this
        Since:
        2.5
      • getSupertype

        Optional<Type> getSupertype()
        Returns the super type if such exists, else empty.
        Returns:
        the super type or empty