Interface Projectable

    • Method Summary

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

      • as

        <B extends Behaviour> B as​(java.lang.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:
        java.lang.IllegalStateException - if a driver cannot be found
        java.lang.IllegalArgumentException - if the projection is not supported
      • is

        <B extends Behaviour> boolean is​(java.lang.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 Behaviour> java.util.Optional<B> project​(java.lang.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