Interface ICustomDataProvider

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods 
      Modifier and TypeMethodDescription
      java.util.Map<java.lang.String,​java.lang.Object>forbiddenGetCustomDataMap​(boolean doCreate)
      Deprecated.
      default <T> TgetCustomData​(java.lang.String name, java.lang.Class<T> valueClass)
      Gets a custom data value with the specified name and a specific valueClass.
      default java.lang.ObjectputCustomData​(java.lang.String name, java.lang.Object value)
      Puts a custom data value with the specified name.
      default java.lang.ObjectputCustomDataIfAbsent​(java.lang.String name, java.lang.Object value)
      Puts a custom data value with the specified name if an existing entry is not present.
    • Method Detail

      • forbiddenGetCustomDataMap

        @Deprecated
        java.util.Map<java.lang.String,​java.lang.Object> forbiddenGetCustomDataMap​(boolean doCreate)
        Deprecated.
        Gets or creates the provider map. This method is not intended to be called by user code, it is used by the system.

        Do not call this method!

        Parameters:
        doCreate - Creates the map if required.
        Returns:
        The map or newly created map, null if not created.

        Note: the map returned is NOT synchronized thus not thread safe. It is up to the caller to synchronize on it to ensure thread safety.

      • putCustomData

        default java.lang.Object putCustomData​(java.lang.String name,
                                               java.lang.Object value)
        Puts a custom data value with the specified name. This property can overwrite any existing value. If this is the case, that value is returned.
        Parameters:
        name - The name of the custom data to ut.
        value - The value to set, null to clear the named custom data value, and return any cleared existing value.
        Returns:
        Any existing overwritten value, null for no previous value.
      • putCustomDataIfAbsent

        default java.lang.Object putCustomDataIfAbsent​(java.lang.String name,
                                                       java.lang.Object value)
        Puts a custom data value with the specified name if an existing entry is not present. If an existing value is present, that value is returned and nothing is put.
        Parameters:
        name - The name of the custom data to put.
        value - The value to set, null to clear the named custom data value, and return any cleared existing value.
        Returns:
        Any existing value, null for no previous value indicating that the value was put successfully.
      • getCustomData

        default <T> T getCustomData​(java.lang.String name,
                                    java.lang.Class<T> valueClass)
        Gets a custom data value with the specified name and a specific valueClass. If an existing value is present of the matching class, that value is returned, otherwise null is returned.
        Parameters:
        name - The name of the custom data to retrieve.
        valueClass - The value class requested upon return.
        Returns:
        The retrieved value if existing and of the matching valueClass, or null if the value was not found by that name, or if the valueClass did not match the existing value in the custom data.