Interface EntityDescriptor

  • All Superinterfaces:
    java.io.Serializable
    All Known Implementing Classes:
    EntityDescriptorImpl

    @Stable
    public interface EntityDescriptor
    extends java.io.Serializable
    An interface representing descriptor of entity.
    • Method Detail

      • getName

        java.lang.String getName()
        Name of the entity.
        Returns:
        name of the entity
      • findAttribute

        <T> java.util.Optional<AttributeDescriptor<T>> findAttribute​(java.lang.String name,
                                                                     boolean includeProtected)
        Find attribute by name.
        Type Parameters:
        T - value type
        Parameters:
        name - name of the attribute to search for
        includeProtected - true to allow search for protected fields (prefixed by _).
        Returns:
        optional found attribute descriptor
      • findAttribute

        default <T> java.util.Optional<AttributeDescriptor<T>> findAttribute​(java.lang.String name)
        Find attribute by name. Do not search protected fields (prefixed by _).
        Type Parameters:
        T - value type
        Parameters:
        name - name of the attribute to search for
        Returns:
        optional found attribute descriptor
      • getAttribute

        default <T> AttributeDescriptor<T> getAttribute​(java.lang.String name,
                                                        boolean includeProtected)
        Get attribute by name.
        Type Parameters:
        T - value type
        Parameters:
        name - name of the attribute to search for
        includeProtected - true to allow search for protected fields (prefixed by _).
        Returns:
        attribute descriptor
      • isTransactional

        default boolean isTransactional()
        Returns:
        true if the entity contains any attribute that has transactions enabled.
      • isSystemEntity

        default boolean isSystemEntity()
        Returns:
        true if this is system entity. System entities are created by the platform itself and should be (directly) accessed by users.
      • getAttribute

        default <T> AttributeDescriptor<T> getAttribute​(java.lang.String name)
        Get attribute by name.
        Type Parameters:
        T - value type
        Parameters:
        name - name of the attribute to search for
        Returns:
        attribute descriptor
      • getAllAttributes

        java.util.List<AttributeDescriptor<?>> getAllAttributes​(boolean includeProtected)
        Find all attributes of this entity.
        Parameters:
        includeProtected - when true then protected attributes are also included (prefixed by _).
        Returns:
        all attributes of entity (including protected or not)
      • getAllAttributes

        default java.util.List<AttributeDescriptor<?>> getAllAttributes()
        List all attribute descriptors of given entity.
        Returns:
        get all unprotected attributes of entity