Package org.apache.sling.testing.mock.sling.services

# Class MockSlingSettingService

java.lang.Object
org.apache.sling.testing.mock.sling.services.MockSlingSettingService

All Implemented Interfaces:
  `org.apache.sling.settings.SlingSettingsService`

public final class MockSlingSettingService extends Object implements org.apache.sling.settings.SlingSettingsService
Mock implementation of `SlingSettingsService`.

## Field Summary

### Fields inherited from interface org.apache.sling.settings.SlingSettingsService

`RUN_MODE_INSTALL_OPTIONS, RUN_MODE_OPTIONS, RUN_MODES_PROPERTY, SLING_HOME, SLING_HOME_URL`

## Constructor Summary

Constructors
Constructor
Description
`MockSlingSettingService()`
Instantiate with no default run modes.
`MockSlingSettingService(@NotNull Set<String> defaultRunModes)`
Instantiate with given run modes

## Method Summary

Modifier and Type
Method
Description
`String`
`getAbsolutePathWithinSlingHome(String relativePath)`
`int`
`getBestRunModeMatchCountFromSpec(String spec)`
`Set<String>`
`getRunModes()`
`String`
`getSlingDescription()`
`URL`
`getSlingHome()`
`String`
`getSlingHomePath()`
`String`
`getSlingId()`
`String`
`getSlingName()`
`void`
`setRunModes(@NotNull Set<String> runModes)`

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

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

## Constructor Details

### MockSlingSettingService

public MockSlingSettingService()
Instantiate with no default run modes.

### MockSlingSettingService

public MockSlingSettingService(@NotNull @NotNull Set<String> defaultRunModes)
Instantiate with given run modes

Parameters:
  `defaultRunModes` - Run modes

## Method Details

### getRunModes

public Set<String> getRunModes()

Specified by:
  `getRunModes` in interface `org.apache.sling.settings.SlingSettingsService`

### setRunModes

public void setRunModes(@NotNull @NotNull Set<String> runModes)

Parameters:
  `runModes` - Rund modes

### getSlingId

public String getSlingId()

Specified by:
  `getSlingId` in interface `org.apache.sling.settings.SlingSettingsService`

### getAbsolutePathWithinSlingHome

public String getAbsolutePathWithinSlingHome(String relativePath)

Specified by:
  `getAbsolutePathWithinSlingHome` in interface `org.apache.sling.settings.SlingSettingsService`

### getSlingHomePath

public String getSlingHomePath()

Specified by:
  `getSlingHomePath` in interface `org.apache.sling.settings.SlingSettingsService`

### getSlingHome

public URL getSlingHome()

Specified by:
  `getSlingHome` in interface `org.apache.sling.settings.SlingSettingsService`

### getSlingName

public String getSlingName()

Specified by:
  `getSlingName` in interface `org.apache.sling.settings.SlingSettingsService`

### getSlingDescription

public String getSlingDescription()

Specified by:
  `getSlingDescription` in interface `org.apache.sling.settings.SlingSettingsService`

### getBestRunModeMatchCountFromSpec

public int getBestRunModeMatchCountFromSpec(String spec)

Parameters:
  `spec` - run mode spec
Returns:
  number of matching run modes