Interface RestEntityEnrichmentManager

All Known Implementing Classes:
DefaultRestEntityEnrichmentManager, MockRestEntityEnrichmentManager

@Internal public interface RestEntityEnrichmentManager
Since:
8.9.0
  • Method Summary

    Modifier and Type
    Method
    Description
    @NonNull Object
    convertAndEnrich(Object entity, SchemaType schemaType)
    Converts the given entity into a RestEntity if the entity has the RestEnrichable annotation or is a PageResponse that contains RestEnrichable entities.
    @NonNull Map<String,Type>
    getEnrichedPropertyTypes(Type type, boolean root)
    Get the types of the properties that may possibly be provided by the enrichers.
    boolean
    Get whether an object type can be enriched using a RestEntity.
    boolean
    Get whether an object type can be enriched using a RestList.
  • Method Details

    • isEnrichableList

      boolean isEnrichableList(Class listType)
      Get whether an object type can be enriched using a RestList.
    • isEnrichableEntity

      boolean isEnrichableEntity(Class entityType)
      Get whether an object type can be enriched using a RestEntity.
    • getEnrichedPropertyTypes

      @NonNull Map<String,Type> getEnrichedPropertyTypes(Type type, boolean root)
      Get the types of the properties that may possibly be provided by the enrichers. This is used to populate the graph-ql schema.
      Parameters:
      type - The type of the object being enriched
      Returns:
      A map of property names to property types
    • convertAndEnrich

      @NonNull Object convertAndEnrich(Object entity, SchemaType schemaType)
      Converts the given entity into a RestEntity if the entity has the RestEnrichable annotation or is a PageResponse that contains RestEnrichable entities.
      Parameters:
      entity - the entity to enrich
      schemaType - rest or graphql
      Returns:
      a converted rest entity or the entity that was given