## org.eclipse.ocl.options
Class BasicOption<T>

    java.lang.Object
      org.eclipse.ocl.options.BasicOption<T>

All Implemented Interfaces:
  Option<T>

    public class BasicOption<T>

extends Object
implements Option<T>

Useful implementation of the `Option` interface for OCL parsing options.

Constructor Summary
`BasicOption(String key, T defaultValue)` Initializes me with my key and default value.

Method Summary
`T` `getDefaultValue()` Obtains the option's default value.
`String` `getKey()` Obtains my string key, which may be used for persistence in a preference store.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### BasicOption

    public BasicOption(String key,
                       T defaultValue)

  Initializes me with my key and default value.

  Parameters:
    `key` - identifies me
    `defaultValue` - my default value

Method Detail

### getKey

    public final String getKey()

  Description copied from interface: `Option`
  Obtains my string key, which may be used for persistence in a preference store.

  Specified by:
    `getKey` in interface `Option<T>`
  Returns:
    my key. Is never `null`

### getDefaultValue

    public final T getDefaultValue()

  Description copied from interface: `Option`
  Obtains the option's default value.

  Specified by:
    `getDefaultValue` in interface `Option<T>`
  Returns:
    my default value, which default-default is `null`

Copyright 2002, 2007 IBM Corporation and others. All Rights Reserved.