Interface UserDataHolder

All Known Subinterfaces:
ASTNode, FileViewProvider, PsiBuilder, UserDataHolderEx
All Known Implementing Classes:
FleetPsiBuilder, GeneratedParserUtilBase.Builder, IndentPsiBuilder, MarkerPsiBuilder, PsiBuilderAdapter, UserDataHolderBase

public interface UserDataHolder
Allows storing custom user data within a model object. This might be preferred to an explicit Map with model objects as keys and custom data in values because this allows the data to be garbage-collected together with the values.

If you need to implement this interface, extend UserDataHolderBase or delegate to its instance instead of writing your own implementation.

  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    getUserData(@NotNull Key<T> key)
     
    <T> void
    putUserData(@NotNull Key<T> key, T value)
    Add a new user data value to this object.
  • Method Details

    • getUserData

      @Nullable <T> T getUserData(@NotNull @NotNull Key<T> key)
      Returns:
      a user data value associated with this object. Doesn't require read action.
    • putUserData

      <T> void putUserData(@NotNull @NotNull Key<T> key, @Nullable T value)
      Add a new user data value to this object. Doesn't require write action.