Class DelegatingPropagateAttributeLoader<T>
- All Implemented Interfaces:
AttributeLoader<T>,MultiRowAttributeLoader<T>,PropagateAttributeLoader<T>,RowAttributeLoader<T>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines if this loader can provide a value for the super-root row.BiFunction<StructureRow,PropagateAttributeContext, AttributeValue<T>> loadChildren(AttributeValue<T> parentValue, PropagateAttributeContext.Parent context) Provider of a loading function for the children of the given parent row.Methods inherited from class DelegatingRowAttributeLoader
isWholeForestDependent, preloadMethods inherited from class DelegatingAttributeLoader
delegate, getAttributeDependencies, getAttributeSpec, getCachingStrategy, getContextDependencies, getGlobalTrail, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface AttributeLoader
getAttributeDependencies, getAttributeSpec, getContextDependencies, getGlobalTrailMethods inherited from interface MultiRowAttributeLoader
getCachingStrategyMethods inherited from interface RowAttributeLoader
isWholeForestDependent, preload
-
Constructor Details
-
DelegatingPropagateAttributeLoader
-
-
Method Details
-
loadChildren
@Nullable public BiFunction<StructureRow,PropagateAttributeContext, loadChildrenAttributeValue<T>> (@NotNull AttributeValue<T> parentValue, @NotNull PropagateAttributeContext.Parent context) Description copied from interface:PropagateAttributeLoaderProvider of a loading function for the children of the given parent row. When there's a need to load a propagate value for row R, then first this method is called for the parent of R. Then the function that is received will be called to calculate the value for R and any other siblings that are also requested in this loading process.
The implementation can make preparatory calculations and then return a function that will produce results for specific rows. The value of the dependencies for the children rows are available only when that function is called.
You should not include costly calculations for all the children rows in the implementation of this method, because
loadChildren()may called even when only one child row needs to be calculated.The implementation must be a stable function - see
PropagateAttributeLoader. Note thatloadChildren()and the functions it produced may be called intermittently without any particular order. In other words, the function produced byloadChildren()should be working even after anotherloadChildren()is called.If for some reason this loader is not applicable for the given row, it should return
null. Note, however, that if multiple propagate loaders work on the same attribute, it could be tricky and lead to unexpected results.- Specified by:
loadChildrenin interfacePropagateAttributeLoader<T>- Parameters:
parentValue- the value of this attribute for the parent row, orAttributeValue.undefined()if there's no parentcontext- loading context- Returns:
- a function that will produce a value for every child row of this parent, given the child row and the loading context, or
nullif the values for the children rows of this parent cannot be loaded with this loader
-
isLoadingSuperRoot
public boolean isLoadingSuperRoot()Description copied from interface:PropagateAttributeLoaderDetermines if this loader can provide a value for the super-root row.
When this method returns
false, the super-root value will always beAttributeValue.undefined(). When it istrue, the super-root value will be determined by callingPropagateAttributeLoader.loadChildren(com.almworks.jira.structure.api.attribute.AttributeValue<T>, com.almworks.jira.structure.api.attribute.loader.PropagateAttributeContext.Parent)withnullas the parent row and super-root as the child row.The returned value must be the same throughout the lifetime of the object.
- Specified by:
isLoadingSuperRootin interfacePropagateAttributeLoader<T>- Returns:
- true if this loader should be called to load the value for the super-root item
- See Also:
-
SuperRootRow
-