Package org.apache.felix.framework

# Class FilterImpl

java.lang.Object
org.apache.felix.framework.FilterImpl

All Implemented Interfaces:
  `Filter`

public class FilterImpl extends Object implements Filter

## Constructor Summary

Constructors
Constructor
Description
`FilterImpl(String filterStr)`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object o)`
Compares this `Filter` to another `Filter`.
`int`
`hashCode()`
Returns the hashCode for this `Filter`.
`boolean`
`match(Dictionary<String,?> dctnr)`
Filter using a `Dictionary` with case insensitive key lookup.
`boolean`
`match(ServiceReference sr)`
Filter using a service's properties.
`boolean`
`matchCase(Dictionary<String,?> dctnr)`
Filter using a `Dictionary`.
`boolean`
`matches(Map<String,?> map)`
Filter using a `Map`.
`String`
`toString()`
Returns this `Filter`'s filter string.

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

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

## Constructor Details

### FilterImpl

public FilterImpl(String filterStr) throws InvalidSyntaxException

Throws:
  `InvalidSyntaxException`

## Method Details

### match

public boolean match(ServiceReference sr)
Description copied from interface: `Filter`
Filter using a service's properties.

This `Filter` is executed using the keys and values of the referenced service's properties. The keys are looked up in a case insensitive manner.

Specified by:
  `match` in interface `Filter`
Parameters:
  `sr` - The reference to the service whose properties are used in the match.
Returns:
  `true` if the service's properties match this `Filter`; `false` otherwise.

### match

public boolean match(Dictionary<String,?> dctnr)
Description copied from interface: `Filter`
Filter using a `Dictionary` with case insensitive key lookup. This `Filter` is executed using the specified `Dictionary`'s keys and values. The keys are looked up in a case insensitive manner.

Specified by:
  `match` in interface `Filter`
Parameters:
  `dctnr` - The `Dictionary` whose key/value pairs are used in the match.
Returns:
  `true` if the `Dictionary`'s values match this filter; `false` otherwise.

### matchCase

public boolean matchCase(Dictionary<String,?> dctnr)
Description copied from interface: `Filter`
Filter using a `Dictionary`. This `Filter` is executed using the specified `Dictionary`'s keys and values. The keys are looked up in a normal manner respecting case.

Specified by:
  `matchCase` in interface `Filter`
Parameters:
  `dctnr` - The `Dictionary` whose key/value pairs are used in the match.
Returns:
  `true` if the `Dictionary`'s values match this filter; `false` otherwise.

### matches

public boolean matches(Map<String,?> map)
Description copied from interface: `Filter`
Filter using a `Map`. This `Filter` is executed using the specified `Map`'s keys and values. The keys are looked up in a normal manner respecting case.

Specified by:
  `matches` in interface `Filter`
Parameters:
  `map` - The `Map` whose key/value pairs are used in the match. Maps with `null` key or values are not supported. A `null` value is considered not present to the filter.
Returns:
  `true` if the `Map`'s values match this filter; `false` otherwise.

### equals

public boolean equals(Object o)
Description copied from interface: `Filter`
Compares this `Filter` to another `Filter`.

This implementation returns the result of calling `this.toString().equals(obj.toString())`.

Specified by:
  `equals` in interface `Filter`
Overrides:
  `equals` in class `Object`
Parameters:
  `o` - The object to compare against this `Filter`.
Returns:
  If the other object is a `Filter` object, then returns the result of calling `this.toString().equals(obj.toString())`; `false` otherwise.

### hashCode

public int hashCode()
Description copied from interface: `Filter`
Returns the hashCode for this `Filter`.

This implementation returns the result of calling `this.toString().hashCode()`.

Specified by:
  `hashCode` in interface `Filter`
Overrides:
  `hashCode` in class `Object`
Returns:
  The hashCode of this `Filter`.

### toString

public String toString()
Description copied from interface: `Filter`
Returns this `Filter`'s filter string.

The filter string is normalized by removing whitespace which does not affect the meaning of the filter.

Specified by:
  `toString` in interface `Filter`
Overrides:
  `toString` in class `Object`
Returns:
  This `Filter`'s filter string.