Package com.complexible.common.base

# Class Option<V>

java.lang.Object
com.complexible.common.base.Option<V>

public final class Option<V> extends Object
Represents a configuration option. A configuration option is used as a key to get and set values from a `Options` structure. In addition, an option has a predefined default value.

Since:
  2.0
Version:
  2.0
Author:
  Evren Sirin

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `Option(String name, V defaultValue)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static <T> Option<T>`
  `create(String name)`
  Creates an option with the given name and `null` default value.
  `static <T> Option<T>`
  `create(String name, T defaultValue)`
  Creates an option with the given name and default value.
  `boolean`
  `equals(Object other)`
  `V`
  `getDefaultValue()`
  Returns the default value for this option.
  `String`
  `getName()`
  `int`
  `hashCode()`
  `void`
  `setDefaultValue(V defaultValue)`
  Sets the default value for this option.
  `String`
  `toString()`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### Option

    protected Option(String name, V defaultValue)

- ## Method Details

  - ### create

    public static <T> Option<T> create(String name)
    Creates an option with the given name and `null` default value.

  - ### create

    public static <T> Option<T> create(String name, T defaultValue)
    Creates an option with the given name and default value.

  - ### getDefaultValue

    public V getDefaultValue()
    Returns the default value for this option.

  - ### setDefaultValue

    public void setDefaultValue(V defaultValue)
    Sets the default value for this option. This will have a global effect.

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### equals

    public boolean equals(Object other)
    Overrides:
      `equals` in class `Object`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### getName

    public String getName()