Package org.apache.felix.http.base.internal.runtime

# Class AbstractInfo<T>

java.lang.Object
org.apache.felix.http.base.internal.runtime.AbstractInfo<T>

All Implemented Interfaces:
  `Comparable<AbstractInfo<T>>`

Direct Known Subclasses:
  `ServletContextHelperInfo`, `WhiteboardServiceInfo`

public abstract class AbstractInfo<T> extends Object implements Comparable<AbstractInfo<T>>
Base class for all info objects. Provides support for ranking and ordering of services.

## Constructor Summary

Constructors
Constructor
Description
`AbstractInfo(int ranking, long serviceId)`
`AbstractInfo(org.osgi.framework.ServiceReference<T> ref)`

## Method Summary

Modifier and Type
Method
Description
`int`
`compareTo(AbstractInfo<T> other)`
Compare two info objects based on their ranking (aka reverse ServiceReference ordering)
`boolean`
`equals(Object obj)`
`protected boolean`
`getBooleanProperty(org.osgi.framework.ServiceReference<T> ref, String key)`
`protected Map<String,String>`
`getInitParams(org.osgi.framework.ServiceReference<T> ref, String prefix)`
Get the init parameters.
`int`
`getRanking()`
`T`
`getService(org.osgi.framework.BundleContext bundleContext)`
Get a service object
`long`
`getServiceId()`
`org.osgi.framework.ServiceReference<T>`
`getServiceReference()`
`protected String[]`
`getStringArrayProperty(org.osgi.framework.ServiceReference<T> ref, String key)`
`protected String`
`getStringProperty(org.osgi.framework.ServiceReference<T> ref, String key)`
`String`
`getTarget()`
`abstract @NotNull String`
`getType()`
Get the type represented by this info
`int`
`hashCode()`
`protected boolean`
`isEmpty(String value)`
`protected boolean`
`isEmpty(String[] value)`
`boolean`
`isSame(AbstractInfo<T> other)`
Compare two info objects
`boolean`
`isValid()`
`void`
`ungetService(org.osgi.framework.BundleContext bundleContext, T service)`
Unget the service object

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

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

## Constructor Details

### AbstractInfo

public AbstractInfo(org.osgi.framework.ServiceReference<T> ref)

### AbstractInfo

public AbstractInfo(int ranking, long serviceId)

## Method Details

### isValid

public boolean isValid()

### compareTo

public int compareTo(AbstractInfo<T> other)
Compare two info objects based on their ranking (aka reverse ServiceReference ordering)

Specified by:
  `compareTo` in interface `Comparable<T>`

### isSame

public boolean isSame(AbstractInfo<T> other)
Compare two info objects

Parameters:
  `other` - The other info object
Returns:
  `true` if the objects are the same

### isEmpty

protected boolean isEmpty(String value)

### isEmpty

protected boolean isEmpty(String[] value)

### getStringProperty

protected String getStringProperty(org.osgi.framework.ServiceReference<T> ref, String key)

### getStringArrayProperty

protected String[] getStringArrayProperty(org.osgi.framework.ServiceReference<T> ref, String key)

### getBooleanProperty

protected boolean getBooleanProperty(org.osgi.framework.ServiceReference<T> ref, String key)

### getInitParams

protected Map<String,String> getInitParams(org.osgi.framework.ServiceReference<T> ref, String prefix)
Get the init parameters.

Parameters:
  `ref` - The service reference
  `prefix` - The prefix
Returns:
  The map of init parameters

### getRanking

public int getRanking()

### getServiceId

public long getServiceId()

### getTarget

public String getTarget()

### getServiceReference

public org.osgi.framework.ServiceReference<T> getServiceReference()

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### equals

public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

### getService

public T getService(org.osgi.framework.BundleContext bundleContext)
Get a service object

Parameters:
  `bundleContext` - context
Returns:
  The object or `null`

### ungetService

public void ungetService(org.osgi.framework.BundleContext bundleContext, T service)
Unget the service object

Parameters:
  `bundleContext` - The bundle context
  `service` - The service object

### getType

@NotNull public abstract @NotNull String getType()
Get the type represented by this info

Returns:
  The type