Package org.eclipse.compare.patch

## Class PatchConfiguration

- java.lang.Object
- - org.eclipse.compare.patch.PatchConfiguration

    public class PatchConfiguration
    extends Object

A patch configuration allows clients to set parameters that control how a patch is applied.

Since:
  3.3
See Also:
  `IFilePatch2`
Restriction:
  This class may be instantiated by clients but is not intended to be subclassed.

### Constructor Summary

Constructors
`PatchConfiguration()`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addHunkFilter​(IHunkFilter filter)` Adds a hunk filter.
`int` `getFuzz()` Return the fuzz factor to be used when applying a patch.
`IHunkFilter[]` `getHunkFilters()` Return an array of hunk filters that have been added to this configuration.
`int` `getPrefixSegmentStripCount()` Return the number of prefix segments to be stripped when attempting to apply a patch.
`Object` `getProperty​(String key)` Return the property associated with the given key or `null` if there is no property for the key.
`boolean` `isIgnoreWhitespace()` Return whether whitespace should be ignored.
`boolean` `isReversed()` Return whether the patch should be reversed when applied.
`void` `removeHunkFilter​(IHunkFilter filter)` Removes a hunk filter.
`void` `setFuzz​(int fuzz)` Set the fuzz factor to be used when applying a patch.
`void` `setIgnoreWhitespace​(boolean ignoreWhitespace)` Set whether whitespace should be ignored
`void` `setPrefixSegmentStripCount​(int stripCount)` Set the number of prefix segments to be stripped when attempting to apply a patch.
`void` `setProperty​(String key, Object value)` Set the property associated with the given key
`void` `setReversed​(boolean reversed)` Set whether the patch should be reversed when applied.

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

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### PatchConfiguration

    public PatchConfiguration()

### Method Detail

#### isReversed

    public boolean isReversed()

Return whether the patch should be reversed when applied.

Returns:
  whether the patch should be reversed when applied

#### setReversed

    public void setReversed​(boolean reversed)

Set whether the patch should be reversed when applied.

Parameters:
  `reversed` - whether the patch should be reversed when applied

#### getPrefixSegmentStripCount

    public int getPrefixSegmentStripCount()

Return the number of prefix segments to be stripped when attempting to apply a patch.

Returns:
  the number of prefix segments to be stripped when attempting to apply a patch

#### setPrefixSegmentStripCount

    public void setPrefixSegmentStripCount​(int stripCount)

Set the number of prefix segments to be stripped when attempting to apply a patch.

Parameters:
  `stripCount` - the number of prefix segments to be stripped when attempting to apply a patch.

#### getFuzz

    public int getFuzz()

Return the fuzz factor to be used when applying a patch. If the fuzz factor is set to -1, then the patcher is to make a best effort to apply the patch by adjusting the fuzz factor accordingly.

Returns:
  the fuzz factor to be used when applying a patch.

#### setFuzz

    public void setFuzz​(int fuzz)

Set the fuzz factor to be used when applying a patch.

Parameters:
  `fuzz` - the fuzz factor to be used when applying a patch.

#### isIgnoreWhitespace

    public boolean isIgnoreWhitespace()

Return whether whitespace should be ignored.

Returns:
  whether whitespace should be ignored

#### setIgnoreWhitespace

    public void setIgnoreWhitespace​(boolean ignoreWhitespace)

Set whether whitespace should be ignored

Parameters:
  `ignoreWhitespace` - whether whitespace should be ignored

#### getProperty

    public Object getProperty​(String key)

Return the property associated with the given key or `null` if there is no property for the key.

Parameters:
  `key` - the key
Returns:
  the property associated with the given key or `null`

#### setProperty

    public void setProperty​(String key,
                            Object value)

Set the property associated with the given key

Parameters:
  `key` - the key
  `value` - the value to be associated with the key

#### addHunkFilter

    public void addHunkFilter​(IHunkFilter filter)

Adds a hunk filter.

Parameters:
  `filter` - the filter
Since:
  org.eclipse.compare.core 3.5

#### removeHunkFilter

    public void removeHunkFilter​(IHunkFilter filter)

Removes a hunk filter.

Parameters:
  `filter` - the filter
Since:
  org.eclipse.compare.core 3.5

#### getHunkFilters

    public IHunkFilter[] getHunkFilters()

Return an array of hunk filters that have been added to this configuration.

Returns:
  an array of hunk filters that have been added to this configuration
Since:
  org.eclipse.compare.core 3.5