Package com.io7m.smfj.processing.api

## Class SMFFilterCommandContext

- java.lang.Object
- - com.io7m.smfj.processing.api.SMFFilterCommandContext

- All Implemented Interfaces:
    `SMFFilterCommandContextType`

      public final class SMFFilterCommandContext
      extends java.lang.Object
      implements SMFFilterCommandContextType

  The context used during filtering.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `SMFFilterCommandContext.Builder` | Builds instances of type `SMFFilterCommandContext`.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static SMFFilterCommandContext.Builder` | `builder()` | Creates a builder for `SMFFilterCommandContext`.
    `static SMFFilterCommandContext` | `copyOf​(SMFFilterCommandContextType instance)` | Creates an immutable copy of a `SMFFilterCommandContextType` value.
    `java.nio.file.Path` | `currentPath()` | The current path.
    `boolean` | `equals​(java.lang.Object another)` | This instance is equal to all instances of `SMFFilterCommandContext` that have equal attribute values.
    `int` | `hashCode()` | Computes a hash code from attributes: `sourceRoot`, `currentPath`.
    `static SMFFilterCommandContext` | `of​(java.nio.file.Path sourceRoot, java.nio.file.Path currentPath)` | Construct a new immutable `SMFFilterCommandContext` instance.
    `java.nio.file.Path` | `sourceRoot()` | The source root directory.
    `java.lang.String` | `toString()` | Prints the immutable value `SMFFilterCommandContext` with attribute values.
    `SMFFilterCommandContext` | `withCurrentPath​(java.nio.file.Path value)` | Copy the current immutable object by setting a value for the `currentPath` attribute.
    `SMFFilterCommandContext` | `withSourceRoot​(java.nio.file.Path value)` | Copy the current immutable object by setting a value for the `sourceRoot` attribute.

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

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

    - ### Methods inherited from interface com.io7m.smfj.processing.api.SMFFilterCommandContextType

      `checkPreconditions, resolvePath`

- - ### Method Detail

    - #### sourceRoot

          public java.nio.file.Path sourceRoot()

      The source root directory. If a filter causes files to be open, they must be descendants of this directory.
      Specified by:
        `sourceRoot` in interface `SMFFilterCommandContextType`
      Returns:
        A source root directory

    - #### currentPath

          public java.nio.file.Path currentPath()

      The current path. If a filter command specifies a relative path, the path is resolved relative to the current path.
      Specified by:
        `currentPath` in interface `SMFFilterCommandContextType`
      Returns:
        The current path
      See Also:
        `SMFFilterCommandContextType.resolvePath(Path)`

    - #### withSourceRoot

          public final SMFFilterCommandContext withSourceRoot​(java.nio.file.Path value)

      Copy the current immutable object by setting a value for the `sourceRoot` attribute. A shallow reference equality check is used to prevent copying of the same value by returning `this`.
      Parameters:
        `value` - A new value for sourceRoot
      Returns:
        A modified copy of the `this` object

    - #### withCurrentPath

          public final SMFFilterCommandContext withCurrentPath​(java.nio.file.Path value)

      Copy the current immutable object by setting a value for the `currentPath` attribute. A shallow reference equality check is used to prevent copying of the same value by returning `this`.
      Parameters:
        `value` - A new value for currentPath
      Returns:
        A modified copy of the `this` object

    - #### equals

          public boolean equals​(java.lang.Object another)

      This instance is equal to all instances of `SMFFilterCommandContext` that have equal attribute values.
      Overrides:
        `equals` in class `java.lang.Object`
      Returns:
        `true` if `this` is equal to `another` instance

    - #### hashCode

          public int hashCode()

      Computes a hash code from attributes: `sourceRoot`, `currentPath`.
      Overrides:
        `hashCode` in class `java.lang.Object`
      Returns:
        hashCode value

    - #### toString

          public java.lang.String toString()

      Prints the immutable value `SMFFilterCommandContext` with attribute values.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        A string representation of the value

    - #### of

          public static SMFFilterCommandContext of​(java.nio.file.Path sourceRoot,
                                                   java.nio.file.Path currentPath)

      Construct a new immutable `SMFFilterCommandContext` instance.
      Parameters:
        `sourceRoot` - The value for the `sourceRoot` attribute
        `currentPath` - The value for the `currentPath` attribute
      Returns:
        An immutable SMFFilterCommandContext instance

    - #### copyOf

          public static SMFFilterCommandContext copyOf​(SMFFilterCommandContextType instance)

      Creates an immutable copy of a `SMFFilterCommandContextType` value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
        `instance` - The instance to copy
      Returns:
        A copied immutable SMFFilterCommandContext instance

    - #### builder

          public static SMFFilterCommandContext.Builder builder()

      Creates a builder for `SMFFilterCommandContext`.

           SMFFilterCommandContext.builder()
              .setSourceRoot(java.nio.file.Path) // required sourceRoot
              .setCurrentPath(java.nio.file.Path) // required currentPath
              .build();

      Returns:
        A new SMFFilterCommandContext builder