Package org.apache.sling.commons.testing.osgi

# Class MockServiceReference

java.lang.Object
org.apache.sling.commons.testing.osgi.MockServiceReference

All Implemented Interfaces:
  `Comparable`, `org.osgi.framework.ServiceReference`

public class MockServiceReference extends Object implements org.osgi.framework.ServiceReference

## Constructor Summary

Constructors
Constructor
Description
`MockServiceReference(org.osgi.framework.Bundle bundle)`

## Method Summary

Modifier and Type
Method
Description
`int`
`compareTo(Object reference)`
`org.osgi.framework.Bundle`
`getBundle()`
`Dictionary<String,Object>`
`getProperties()`
`Object`
`getProperty(String key)`
`String[]`
`getPropertyKeys()`
`org.osgi.framework.Bundle[]`
`getUsingBundles()`
`boolean`
`isAssignableTo(org.osgi.framework.Bundle bundle, String className)`
`void`
`setProperty(String key, Object value)`

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

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

## Constructor Details

### MockServiceReference

public MockServiceReference(org.osgi.framework.Bundle bundle)

## Method Details

### getBundle

public org.osgi.framework.Bundle getBundle()

Specified by:
  `getBundle` in interface `org.osgi.framework.ServiceReference`

### setProperty

public void setProperty(String key, Object value)

### getProperty

public Object getProperty(String key)

Specified by:
  `getProperty` in interface `org.osgi.framework.ServiceReference`

### getPropertyKeys

public String[] getPropertyKeys()

Specified by:
  `getPropertyKeys` in interface `org.osgi.framework.ServiceReference`

### getUsingBundles

public org.osgi.framework.Bundle[] getUsingBundles()

Specified by:
  `getUsingBundles` in interface `org.osgi.framework.ServiceReference`

### isAssignableTo

public boolean isAssignableTo(org.osgi.framework.Bundle bundle, String className)

Specified by:
  `isAssignableTo` in interface `org.osgi.framework.ServiceReference`

### compareTo

public int compareTo(Object reference)

Specified by:
  `compareTo` in interface `Comparable`
Specified by:
  `compareTo` in interface `org.osgi.framework.ServiceReference`

### getProperties

public Dictionary<String,Object> getProperties()

Specified by:
  `getProperties` in interface `org.osgi.framework.ServiceReference`