org.eclipse.cdt.core.options

## Interface OptionStorage

All Known Implementing Classes:
  OsgiPreferenceStorage

    public interface OptionStorage

Provides metadata-based access to an enclosed storage of options.

### Method Summary

All Methods Instance Methods Abstract Methods
`<V> boolean` `consumable(Class<V> valueType)` Checks if the value type can be consumed by an enclosed storage.
`<V> V` `load(OptionMetadata<V> option)` Loads the value of specified option from an enclosed storage.
`<V> void` `save(V value, OptionMetadata<V> option)` Saves the value of specified option to the enclosed storage.

### Method Detail

#### consumable

    <V> boolean consumable(Class<V> valueType)

Checks if the value type can be consumed by an enclosed storage.

Type Parameters:
  `V` - the value type for the option
Parameters:
  `valueType` - the value type to be checked
Returns:
  true if this value type can be consumed by an enclosed storage and false otherwise

#### load

    <V> V load(OptionMetadata<V> option)

Loads the value of specified option from an enclosed storage. If the value is not found returns the option default value.

Type Parameters:
  `V` - the value type for the option
Parameters:
  `option` - the option metadata, must not be `null`.
Returns:
  the option value or default value if option is unknown
Throws:
  `UnsupportedOperationException` - for unsupported option value types
See Also:
  `consumable(Class)`, `OptionMetadata`

#### save

    <V> void save(V value,
                  OptionMetadata<V> option)

Saves the value of specified option to the enclosed storage.

Type Parameters:
  `V` - the value type for the option
Parameters:
  `value` - to be saved, must not be `null`.
  `option` - the option metadata, must not be `null`.
Throws:
  `UnsupportedOperationException` - for unsupported option value types
See Also:
  `consumable(Class)`, `OptionMetadata`