## com.puppycrawl.tools.checkstyle.checks
Class AbstractOption

    java.lang.Object
      com.puppycrawl.tools.checkstyle.checks.AbstractOption

All Implemented Interfaces:
  Serializable

Direct Known Subclasses:
  BlockOption, LeftCurlyOption, LineSeparatorOption, OperatorWrapOption, PadOption, PersistenceOption, RightCurlyOption

    public abstract class AbstractOption

extends Object
implements Serializable

Abstract class that represents options.

Author:
  Oliver Burn, Rick Giles
See Also:
  Serialized Form

Constructor Summary
`protected` `AbstractOption(String aStrRep)` Creates a new `AbstractOption` instance.

Method Summary
`AbstractOption` `decode(String aStrRep)` Returns the option specified by a string representation.
`protected abstract Map` `getStrToOpt()` Returns the map from string representations to options.
`protected Object` `readResolve()` Ensures that we don't get multiple instances of one AbstractOption during deserialization.
`String` `toString()`

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

Constructor Detail

### AbstractOption

    protected AbstractOption(String aStrRep)

  Creates a new `AbstractOption` instance.

  Parameters:
    `aStrRep` - the string representation

Method Detail

### getStrToOpt

    protected abstract Map getStrToOpt()

  Returns the map from string representations to options.

  Returns:
    `Map` from strings to options.

### decode

    public AbstractOption decode(String aStrRep)

  Returns the option specified by a string representation. If no option exists then null is returned.

  Parameters:
    `aStrRep` - the String representation to parse
  Returns:
    the `AbstractOption` value represented by aStrRep, or null if none exists.

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

### readResolve

    protected Object readResolve()
                          throws ObjectStreamException

  Ensures that we don't get multiple instances of one AbstractOption during deserialization. See Section 3.6 of the Java Object Serialization Specification for details.

  Returns:
    the serialization replacement object
  Throws:
    `ObjectStreamException` - if a deserialization error occurs

Back to the Checkstyle Home Page