Interface ReferencePath

All Known Subinterfaces:
CollectionItemReferencePath, MapItemReferencePath, PropertyReferencePath

public sealed interface ReferencePath permits CollectionItemReferencePath, MapItemReferencePath, PropertyReferencePath
Represents a reference path used for tracking references within serialized or deserialized data structures. This interface serves as a base for specific types of reference paths such as property references, collection item references, and map item references.

It allows encapsulating and constructing paths for identifying specific items or properties in complex object graphs, making it useful in serialization and deserialization processes where tracking the location of errors or data modifications is required.

Since:
2.14
Author:
Denis Stepanov
  • Method Summary

    Modifier and Type
    Method
    Description
    io.micronaut.core.type.Argument<?>
     
    ofCollection(Class<?> type, io.micronaut.core.type.Argument<?> collectionArgument, int index)
    Creates a reference path for a specific item within a collection.
    ofMap(Class<?> type, io.micronaut.core.type.Argument<?> mapArgument, String key)
    Creates a reference path for a specific item within a map.
    ofProperty(Class<?> beanType, io.micronaut.core.type.Argument<?> property)
    Creates a reference path for a property of a specified bean type.
  • Method Details

    • ofProperty

      static ReferencePath ofProperty(Class<?> beanType, io.micronaut.core.type.Argument<?> property)
      Creates a reference path for a property of a specified bean type.
      Parameters:
      beanType - The class of the bean containing the property.
      property - The argument representing the property.
      Returns:
      A ReferencePath instance representing the property reference path.
    • ofCollection

      static ReferencePath ofCollection(Class<?> type, io.micronaut.core.type.Argument<?> collectionArgument, int index)
      Creates a reference path for a specific item within a collection.
      Parameters:
      type - The class type of the collection.
      collectionArgument - The collection argument.
      index - The index of the item within the collection.
      Returns:
      A ReferencePath instance representing the collection item reference path.
    • ofMap

      static ReferencePath ofMap(Class<?> type, io.micronaut.core.type.Argument<?> mapArgument, String key)
      Creates a reference path for a specific item within a map.
      Parameters:
      type - The class type of the map.
      mapArgument - The map argument.
      key - The key of the item within the map.
      Returns:
      A ReferencePath instance representing the map item reference path.
    • getArgument

      io.micronaut.core.type.Argument<?> getArgument()
      Returns:
      The referenced argument