Permalink
Browse files

HUEditorViewBuilder.addAdditionalRelatedProcessDescriptors(list)

  • Loading branch information...
teosarca committed Dec 6, 2017
1 parent 2df138f commit 01a8ffe7cce065d01e722ad048fda1c5ebc9f913
Showing with 17 additions and 6 deletions.
  1. +17 −6 src/main/java/de/metas/ui/web/handlingunits/HUEditorViewBuilder.java
@@ -59,7 +59,7 @@
private List<DocumentFilter> stickyFilters;
private List<DocumentFilter> filters;
private DocumentFilterDescriptorsProvider filterDescriptors = NullDocumentFilterDescriptorsProvider.instance;
private List<DocumentQueryOrderBy> orderBys = null;
private LinkedHashMap<String, Object> parameters;
@@ -172,6 +172,17 @@ public HUEditorViewBuilder addAdditionalRelatedProcessDescriptor(@NonNull final
return this;
}
public HUEditorViewBuilder addAdditionalRelatedProcessDescriptors(@NonNull final List<RelatedProcessDescriptor> descriptors)
{
if (additionalRelatedProcessDescriptors == null)
{
additionalRelatedProcessDescriptors = new ArrayList<>();
}
additionalRelatedProcessDescriptors.addAll(descriptors);
return this;
}
ImmutableList<RelatedProcessDescriptor> getAdditionalRelatedProcessDescriptors()
{
return additionalRelatedProcessDescriptors != null && !additionalRelatedProcessDescriptors.isEmpty() ? ImmutableList.copyOf(additionalRelatedProcessDescriptors) : ImmutableList.of();
@@ -209,29 +220,29 @@ public HUEditorViewBuilder setFilters(final List<DocumentFilter> filters)
{
return filters != null ? filters : ImmutableList.of();
}
public HUEditorViewBuilder orderBy(@NonNull final DocumentQueryOrderBy orderBy)
{
if(orderBys == null)
if (orderBys == null)
{
orderBys = new ArrayList<>();
}
orderBys.add(orderBy);
return this;
}
public HUEditorViewBuilder orderBys(@NonNull final List<DocumentQueryOrderBy> orderBys)
{
this.orderBys = new ArrayList<>(orderBys);
return this;
}
public HUEditorViewBuilder clearOrderBys()
{
this.orderBys = null;
return this;
}
private ImmutableList<DocumentQueryOrderBy> getOrderBys()
{
return orderBys != null ? ImmutableList.copyOf(orderBys) : ImmutableList.of();

0 comments on commit 01a8ffe

Please sign in to comment.