Interface UserDataHolder


  • public interface UserDataHolder
    Allows to store 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.
    • Method Detail

      • getUserData

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

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