Class ContributionImpl<K,T>
- java.lang.Object
-
- org.nuxeo.runtime.contribution.impl.ContributionImpl<K,T>
-
- All Implemented Interfaces:
Iterable<T>,Contribution<K,T>
public class ContributionImpl<K,T> extends Object implements Contribution<K,T>
- Author:
- Bogdan Stefanescu
-
-
Field Summary
Fields Modifier and Type Field Description protected Set<Contribution<K,T>>dependenciesprotected Set<Contribution<K,T>>dependentsprotected List<T>fragmentsprotected booleanisResolvedprotected List<T>mainFragmentsprotected KprimaryKeyprotected AbstractContributionRegistry<K,T>registryprotected Tvalue
-
Constructor Summary
Constructors Constructor Description ContributionImpl(AbstractContributionRegistry<K,T> reg, K primaryKey)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFragment(T fragment, K... superKeys)protected booleancheckIsResolved()booleanequals(Object obj)Set<Contribution<K,T>>getDependencies()Set<Contribution<K,T>>getDependents()TgetFragment(int index)KgetId()ContributionRegistry<K,T>getRegistry()Set<Contribution<K,T>>getUnresolvedDependencies()TgetValue()inthashCode()booleanisEmpty()booleanisPhantom()booleanisRegistered()booleanisResolved()Iterator<T>iterator()booleanremoveFragment(Object fragment)voidresolve()intsize()StringtoString()voidunregister()voidunresolve()protected voidupdate()Called each time a fragment is added or removed to update resolved state and to fire update notifications to the registry owning that contribution-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
registry
protected final AbstractContributionRegistry<K,T> registry
-
primaryKey
protected final K primaryKey
-
dependencies
protected final Set<Contribution<K,T>> dependencies
-
dependents
protected final Set<Contribution<K,T>> dependents
-
value
protected T value
-
isResolved
protected boolean isResolved
-
-
Constructor Detail
-
ContributionImpl
public ContributionImpl(AbstractContributionRegistry<K,T> reg, K primaryKey)
-
-
Method Detail
-
getRegistry
public ContributionRegistry<K,T> getRegistry()
- Specified by:
getRegistryin interfaceContribution<K,T>
-
getId
public K getId()
- Specified by:
getIdin interfaceContribution<K,T>- Returns:
- the primaryKey.
-
getDependencies
public Set<Contribution<K,T>> getDependencies()
- Specified by:
getDependenciesin interfaceContribution<K,T>
-
getDependents
public Set<Contribution<K,T>> getDependents()
- Specified by:
getDependentsin interfaceContribution<K,T>
-
getUnresolvedDependencies
public Set<Contribution<K,T>> getUnresolvedDependencies()
- Specified by:
getUnresolvedDependenciesin interfaceContribution<K,T>
-
checkIsResolved
protected boolean checkIsResolved()
-
size
public int size()
- Specified by:
sizein interfaceContribution<K,T>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceContribution<K,T>
-
getFragment
public T getFragment(int index)
- Specified by:
getFragmentin interfaceContribution<K,T>
-
removeFragment
public boolean removeFragment(Object fragment)
- Specified by:
removeFragmentin interfaceContribution<K,T>
-
addFragment
public void addFragment(T fragment, K... superKeys)
- Specified by:
addFragmentin interfaceContribution<K,T>
-
getValue
public T getValue()
- Specified by:
getValuein interfaceContribution<K,T>
-
isPhantom
public boolean isPhantom()
- Specified by:
isPhantomin interfaceContribution<K,T>
-
isResolved
public boolean isResolved()
- Specified by:
isResolvedin interfaceContribution<K,T>
-
isRegistered
public boolean isRegistered()
- Specified by:
isRegisteredin interfaceContribution<K,T>
-
update
protected void update()
Called each time a fragment is added or removed to update resolved state and to fire update notifications to the registry owning that contribution
-
unregister
public void unregister()
- Specified by:
unregisterin interfaceContribution<K,T>
-
unresolve
public void unresolve()
- Specified by:
unresolvein interfaceContribution<K,T>
-
resolve
public void resolve()
- Specified by:
resolvein interfaceContribution<K,T>
-
-