Package org.apache.sling.testing.paxexam

# Class SlingVersionResolver

java.lang.Object
org.apache.sling.testing.paxexam.SlingVersionResolver

All Implemented Interfaces:
  `org.ops4j.pax.exam.options.MavenUrlReference.VersionResolver`

public class SlingVersionResolver extends Object implements org.ops4j.pax.exam.options.MavenUrlReference.VersionResolver
Sling's Version Resolver for Sling's Options.

NOTE: This file is generated from Sling's Karaf Features

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`SLING_GROUP_ID`

## Constructor Summary

Constructors
Constructor
Description
`SlingVersionResolver()`
Creates a new `SlingVersionResolver`.

## Method Summary

Modifier and Type
Method
Description
`static int`
`getJavaVersion()`
Gets the Java major version from System property `java.specification.version` or `0` in case of error.
`String`
`getVersion(String groupId, String artifactId)`
Gets the version of the bundle.
`String`
`setVersion(String groupId, String artifactId, String version)`
Sets the version of the bundle.
`String`
`setVersionFromProject(String groupId, String artifactId)`
Sets the version of the bundle by using the declared version from Maven project.

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

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

## Field Details

### SLING_GROUP_ID

public static final String SLING_GROUP_ID

See Also:
  - Constant Field Values

## Constructor Details

### SlingVersionResolver

public SlingVersionResolver()
Creates a new `SlingVersionResolver`.

## Method Details

### setVersion

public String setVersion(String groupId, String artifactId, String version)
Sets the version of the bundle.

Parameters:
  `groupId` - the group ID
  `artifactId` - the artifact ID
  `version` - the version
Returns:
  the previous version, or `null`

### setVersionFromProject

public String setVersionFromProject(String groupId, String artifactId)
Sets the version of the bundle by using the declared version from Maven project.

Parameters:
  `groupId` - the group ID
  `artifactId` - the artifact ID
Returns:
  the previous version, or `null`

### getVersion

public String getVersion(String groupId, String artifactId)
Gets the version of the bundle.

Specified by:
  `getVersion` in interface `org.ops4j.pax.exam.options.MavenUrlReference.VersionResolver`
Parameters:
  `groupId` - the group ID
  `artifactId` - the artifact ID
Returns:
  the version, or `null`

### getJavaVersion

public static int getJavaVersion()
Gets the Java major version from System property `java.specification.version` or `0` in case of error.

Returns:
  the Java version