Class FactoryProvider<I> (2.0.0)

public abstract class FactoryProvider<I> implements Comparable<FactoryProvider<?>>

A base class for service factory creation that can be registered with the ProviderRegistry.

Inheritance

Object > FactoryProvider<I>

Type Parameter

NameDescription
I

Constructors

FactoryProvider(Class<I> baseInterface)

protected FactoryProvider(Class<I> baseInterface)
Parameter
NameDescription
baseInterfaceClass<I>

Methods

compareTo(FactoryProvider<?> o)

public int compareTo(FactoryProvider<?> o)

This ensures that a list of these will be sorted so that higher precedence entries come later in the list.

Parameter
NameDescription
oFactoryProvider<?>
Returns
TypeDescription
int

equals(Object o)

public boolean equals(Object o)

Included to support sorting by precedence (@see #compareTo(FactoryProvider))

Parameter
NameDescription
oObject
Returns
TypeDescription
boolean
Overrides

getBaseInterface()

protected Class<I> getBaseInterface()
Returns
TypeDescription
Class<I>

getFactoryInstance()

protected abstract I getFactoryInstance()

Return an instance of the factory

Returns
TypeDescription
I

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides