org.apache.felix.ipojo.dependency.impl

## Class TransformedServiceReferenceImpl<S>

- java.lang.Object
- - org.apache.felix.ipojo.dependency.impl.TransformedServiceReferenceImpl<S>

All Implemented Interfaces:
  java.lang.Comparable<java.lang.Object>, TransformedServiceReference<S>, org.osgi.framework.ServiceReference<S>

    public class TransformedServiceReferenceImpl<S>
    extends java.lang.Object
    implements TransformedServiceReference<S>

Implements transformed service reference.

### Field Summary

### Fields inherited from interface org.apache.felix.ipojo.dependency.interceptors.TransformedServiceReference

`FORBIDDEN_KEYS`

### Constructor Summary

Constructors
Constructor and Description
`TransformedServiceReferenceImpl(org.osgi.framework.ServiceReference<S> origin)`

### Method Summary

All Methods Instance Methods Concrete Methods
`TransformedServiceReferenceImpl<S>` `addProperty(java.lang.String name, java.lang.Object value)` Adds a property to the reference
`TransformedServiceReference<S>` `addPropertyIfAbsent(java.lang.String name, java.lang.Object value)` Adds a property to the service reference if this property is not already set on the reference.
`int` `compareTo(java.lang.Object reference)` Compares two service references.
`boolean` `contains(java.lang.String name)` Does the service reference contains the given property ?
`boolean` `equals(java.lang.Object o)`
`java.lang.Object` `get(java.lang.String name)` Gets the current value of a property.
`org.osgi.framework.Bundle` `getBundle()`
`java.lang.Object` `getProperty(java.lang.String key)`
`java.lang.String[]` `getPropertyKeys()`
`org.osgi.framework.Bundle[]` `getUsingBundles()`
`org.osgi.framework.ServiceReference<S>` `getWrappedReference()` Gets the wrapped service reference
`int` `hashCode()`
`boolean` `isAssignableTo(org.osgi.framework.Bundle bundle, java.lang.String className)`
`TransformedServiceReferenceImpl<S>` `removeProperty(java.lang.String name)` Removes a property from the reference.
`java.lang.String` `toString()`

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

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

### Constructor Detail

#### TransformedServiceReferenceImpl

    public TransformedServiceReferenceImpl(org.osgi.framework.ServiceReference<S> origin)

### Method Detail

#### addProperty

    public TransformedServiceReferenceImpl<S> addProperty(java.lang.String name,
                                                          java.lang.Object value)

Description copied from interface: `TransformedServiceReference`
Adds a property to the reference

Specified by:
  `addProperty` in interface `TransformedServiceReference<S>`
Parameters:
  `name` - the property name
  `value` - the value (must not be null)
Returns:
  the current transformed service reference

#### addPropertyIfAbsent

    public TransformedServiceReference<S> addPropertyIfAbsent(java.lang.String name,
                                                              java.lang.Object value)

Description copied from interface: `TransformedServiceReference`
Adds a property to the service reference if this property is not already set on the reference.

Specified by:
  `addPropertyIfAbsent` in interface `TransformedServiceReference<S>`
Parameters:
  `name` - the property name
  `value` - the value
Returns:
  the current transformed service reference

#### get

    public java.lang.Object get(java.lang.String name)

Description copied from interface: `TransformedServiceReference`
Gets the current value of a property.

Specified by:
  `get` in interface `TransformedServiceReference<S>`
Parameters:
  `name` - the property name
Returns:
  the current value of the property, null if not in the properties.

#### removeProperty

    public TransformedServiceReferenceImpl<S> removeProperty(java.lang.String name)

Description copied from interface: `TransformedServiceReference`
Removes a property from the reference.

Specified by:
  `removeProperty` in interface `TransformedServiceReference<S>`
Parameters:
  `name` - the property name
Returns:
  the current transformed service reference

#### contains

    public boolean contains(java.lang.String name)

Description copied from interface: `TransformedServiceReference`
Does the service reference contains the given property ?

Specified by:
  `contains` in interface `TransformedServiceReference<S>`
Parameters:
  `name` - the property name
Returns:
  whether the current reference contains a property with the given name

#### getWrappedReference

    public org.osgi.framework.ServiceReference<S> getWrappedReference()

Description copied from interface: `TransformedServiceReference`
Gets the wrapped service reference

Specified by:
  `getWrappedReference` in interface `TransformedServiceReference<S>`
Returns:
  the wrapped service reference

#### getProperty

    public java.lang.Object getProperty(java.lang.String key)

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

#### getPropertyKeys

    public java.lang.String[] getPropertyKeys()

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

#### getBundle

    public org.osgi.framework.Bundle getBundle()

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

#### getUsingBundles

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

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

#### isAssignableTo

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

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

#### compareTo

    public int compareTo(java.lang.Object reference)

Compares two service references. This method is not delegated as we may have modified some of the properties using for the ranking.

Specified by:
  `compareTo` in interface `java.lang.Comparable<java.lang.Object>`
Specified by:
  `compareTo` in interface `org.osgi.framework.ServiceReference<S>`
Parameters:
  `reference` - the reference
Returns:
  0, 1 or -1 depending of the reference.

#### equals

    public boolean equals(java.lang.Object o)

Overrides:
  `equals` in class `java.lang.Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `java.lang.Object`

#### toString

    public java.lang.String toString()

Overrides:
  `toString` in class `java.lang.Object`