Interface Projectable

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      <B extends Behaviour>
      B
      as​(Class<B> projectionClass)
      Returns the specified projection of this entity if such projection is supported.
      <B extends Behaviour>
      boolean
      is​(Class<B> projectionClass)
      Returns true if this entity is capable of being projected as the specified class.
      default <B extends Behaviour>
      Optional<B>
      project​(Class<B> projectionClass)
      Returns the specified projection of this entity if such projection is supported.
    • Method Detail

      • as

        <B extends Behaviour> B as​(Class<B> projectionClass)
        Returns the specified projection of this entity if such projection is supported.
        Type Parameters:
        B - type of behaviour
        Parameters:
        projectionClass - requested projection class
        Returns:
        projection instance
        Throws:
        IllegalStateException - if a driver cannot be found
        IllegalArgumentException - if the projection is not supported
      • is

        <B extends Behaviour> boolean is​(Class<B> projectionClass)
        Returns true if this entity is capable of being projected as the specified class.
        Type Parameters:
        B - type of behaviour
        Parameters:
        projectionClass - requested projection class
        Returns:
        true if the requested projection is supported
      • project

        default <B extends BehaviourOptional<B> project​(Class<B> projectionClass)
        Returns the specified projection of this entity if such projection is supported.
        Type Parameters:
        B - type of behaviour
        Parameters:
        projectionClass - requested projection class
        Returns:
        projection instance