Interface IPreferenceMetadataStore

  • All Known Implementing Classes:
    OsgiPreferenceMetadataStore

    public interface IPreferenceMetadataStore
    Provides metadata-based access to a preference store.
    Since:
    3.8
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      <V> boolean handles​(Class<V> valueType)
      Checks if this value type can be handled by this preference store.
      <V> V load​(PreferenceMetadata<V> preference)
      Loads the value of specified preference from an enclosed storage.
      <V> void save​(V value, PreferenceMetadata<V> preference)
      Saves the value of specified preference to the enclosed storage.
    • Method Detail

      • handles

        <V> boolean handles​(Class<V> valueType)
        Checks if this value type can be handled by this preference store.
        Type Parameters:
        V - the value type for the preference
        Parameters:
        valueType - the value type to be checked
        Returns:
        true if this value type can be handled by this preference store and false otherwise
      • load

        <V> V load​(PreferenceMetadata<V> preference)
        Loads the value of specified preference from an enclosed storage. If the value is not found returns the preference default value.
        Type Parameters:
        V - the value type for the preference
        Parameters:
        preference - the preference metadata, must not be null.
        Returns:
        the preference value or default value if preference is unknown
        Throws:
        UnsupportedOperationException - for unsupported preference value types
        See Also:
        handles(Class), PreferenceMetadata
      • save

        <V> void save​(V value,
                      PreferenceMetadata<V> preference)
        Saves the value of specified preference to the enclosed storage.
        Type Parameters:
        V - the value type for the preference
        Parameters:
        value - to be saved, must not be null.
        preference - the preference metadata, must not be null.
        Throws:
        UnsupportedOperationException - for unsupported preference value types
        See Also:
        handles(Class), PreferenceMetadata