Package org.gradle.api.plugins.jvm

## Class PlatformDependencyModifiers.EnforcedPlatformDependencyModifier

- java.lang.Object
- - org.gradle.api.plugins.jvm.PlatformDependencyModifiers.EnforcedPlatformDependencyModifier

- All Implemented Interfaces:
    `DependencyModifier`
  Enclosing interface:
    PlatformDependencyModifiers

      @Incubating
      public abstract static class PlatformDependencyModifiers.EnforcedPlatformDependencyModifier
      extends java.lang.Object
      implements DependencyModifier

  Implementation for the enforced platform dependency modifier.
  Since:
    8.0
  See Also:
    `modify(ModuleDependency)`

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `EnforcedPlatformDependencyModifier()` |

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected abstract ObjectFactory` | `getObjectFactory()` | Injected service to create named objects.
    `<D extends ModuleDependency> D` | `modify​(D dependency)` | Takes a given `ModuleDependency` and modifies the dependency to select the variant of the given module.

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

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

    - ### Methods inherited from interface org.gradle.api.artifacts.dsl.DependencyModifier

      `getDependencyFactory, modify, modify, modify`

- - ### Constructor Detail

    - #### EnforcedPlatformDependencyModifier

          public EnforcedPlatformDependencyModifier()

  - ### Method Detail

    - #### getObjectFactory

          @Inject
          protected abstract ObjectFactory getObjectFactory()

      Injected service to create named objects.
      Returns:
        injected service
      Implementation Requirements:
        Do not implement this method. Gradle generates the implementation automatically.

    - #### modify

          public <D extends ModuleDependency> D modify​(D dependency)

      Takes a given `ModuleDependency` and modifies the dependency to select the variant of the given module. Dependency resolution may fail if the given module does not have a compatible variant.

      Selects the enforced platform variant of the given dependency.
      Specified by:
        `modify` in interface `DependencyModifier`
      Type Parameters:
        `D` - the type of the `ModuleDependency`
      Parameters:
        `dependency` - the dependency to modify
      Returns:
        the modified dependency