Package cn.sliew.milky.component
Class AbstractComponentRegistry<E extends Component,C>
- java.lang.Object
-
- cn.sliew.milky.registry.AbstractRegistry<E,C>
-
- cn.sliew.milky.component.AbstractComponentRegistry<E,C>
-
- All Implemented Interfaces:
ComponentLookupService,ComponentRegistry<E,C>,Registry<E,C>,Iterable<E>
public abstract class AbstractComponentRegistry<E extends Component,C> extends AbstractRegistry<E,C> implements ComponentRegistry<E,C>
component base implemention.
-
-
Field Summary
-
Fields inherited from class cn.sliew.milky.registry.AbstractRegistry
configurations, entries, listeners
-
-
Constructor Summary
Constructors Constructor Description AbstractComponentRegistry()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanexists(Component component)booleanexists(String name)Set<String>lookup(AttributeKey key)Set<String>lookup(Tag tag)Set<String>lookup(Class componentType)Optional<E>lookup(String name)-
Methods inherited from class cn.sliew.milky.registry.AbstractRegistry
addConfiguration, computeIfAbsent, exist, find, getConfiguration, iterator, registerListener, remove, replace
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Methods inherited from interface cn.sliew.milky.registry.Registry
addConfiguration, exist, find, getConfiguration, getDefaultConfig, registerListener, remove, replace
-
-
-
-
Method Detail
-
lookup
public Optional<E> lookup(String name)
- Specified by:
lookupin interfaceComponentLookupService- Parameters:
name- component unique name- Returns:
- Component indentified by unique name
-
lookup
public Set<String> lookup(Class componentType)
- Specified by:
lookupin interfaceComponentLookupService- Parameters:
componentType- component class- Returns:
- all component names by component type
-
lookup
public Set<String> lookup(Tag tag)
- Specified by:
lookupin interfaceComponentLookupService- Parameters:
tag- the tag- Returns:
- all component by specified tag
-
lookup
public Set<String> lookup(AttributeKey key)
- Specified by:
lookupin interfaceComponentLookupService- Parameters:
key- the attribute- Returns:
- all component by specified attribute
-
exists
public boolean exists(String name)
- Specified by:
existsin interfaceComponentLookupService- Parameters:
name- component unique name- Returns:
- true if component indentified by unique name exists, otherwise false
-
exists
public boolean exists(Component component)
- Specified by:
existsin interfaceComponentLookupService- Returns:
- true if component exists, otherwise false
-
-