From 98368379bd9e5645e0de474334334917da71159d Mon Sep 17 00:00:00 2001 From: MatthijsSmets Date: Thu, 27 Jun 2024 11:37:38 +0200 Subject: [PATCH] refactor: formatting --- src/main/java/nl/nn/testtool/filter/View.java | 218 +++++++++--------- 1 file changed, 109 insertions(+), 109 deletions(-) diff --git a/src/main/java/nl/nn/testtool/filter/View.java b/src/main/java/nl/nn/testtool/filter/View.java index e8ded2aa..0d04f6b8 100644 --- a/src/main/java/nl/nn/testtool/filter/View.java +++ b/src/main/java/nl/nn/testtool/filter/View.java @@ -40,114 +40,114 @@ */ @Dependent public class View implements BeanParent { - protected String name; - protected String nodeLinkStrategy; - private @Setter @Getter @Inject @Autowired LogStorage debugStorage; - private @Setter @Getter @Inject @Autowired List metadataNames; - private Map metadataFilter; - private List checkpointMatchers; - private BeanParent beanParent; - private Echo2Application echo2Application; - private @Inject @Autowired MetadataExtractor metadataExtractor; - - protected enum NodeLinkStrategy { - PATH, - CHECKPOINT_NUMBER, - NONE - } - - public void setName(String name) { - this.name = name; - } - - public String getName() { - return name; - } - - public void setNodeLinkStrategy(String nodeLinkStrategy) { - this.nodeLinkStrategy = nodeLinkStrategy; - } - - public String getNodeLinkStrategy() { - if (nodeLinkStrategy == null) { - return NodeLinkStrategy.PATH.toString(); - } - return nodeLinkStrategy; - } - - public void setMetadataFilter(Map metadataFilter) { - this.metadataFilter = metadataFilter; - } - - public Map getMetadataFilter() { - return metadataFilter; - } - - public void setCheckpointMatchers(List checkpointMatchers) { - this.checkpointMatchers = checkpointMatchers; - } - - /** - * @see nl.nn.testtool.echo2.Echo2Application#initBean() - */ - public void initBean(BeanParent beanParent) { - this.beanParent = beanParent; - this.echo2Application = Echo2Application.getEcho2Application(beanParent, this); - } - - public BeanParent getBeanParent() { - return beanParent; - } - - public Echo2Application getEcho2Application() { - return echo2Application; - } - - public String isOpenReportAllowed(Object StorageId) { - return ReportsComponent.OPEN_REPORT_ALLOWED; - } - - public boolean showCheckpoint(Report report, Checkpoint checkpoint) { - boolean match = false; - if (checkpointMatchers == null) { - match = true; - } - for (int i = 0; !match && i < checkpointMatchers.size(); i++) { - CheckpointMatcher checkpointMatcher = checkpointMatchers.get(i); - match = checkpointMatcher.match(report, checkpoint); - } - return match; - } - - public String toString() { - return getName(); - } - - public Map toHashMap(boolean isDefaultView) { - Map metadataTypes = new HashMap<>(); - for (String metadataName : getMetadataNames()) { - metadataTypes.put(metadataName, metadataExtractor.getType(metadataName)); - } - - return new HashMap() {{ - put("storageName", debugStorage.getName()); - put("defaultView", isDefaultView); - put("metadataNames", metadataNames); - put("metadataLabels", getMetadataLabels()); - put("crudStorage", debugStorage instanceof CrudStorage); - put("nodeLinkStrategy", nodeLinkStrategy); - put("name", getName()); - put("metadataTypes", metadataTypes); - }}; - } - - public List getMetadataLabels() { - List metadataLabels = new ArrayList<>(); - for (String metadataName : getMetadataNames()) { - metadataLabels.add(metadataExtractor.getLabel(metadataName)); - } - - return metadataLabels; - } + protected String name; + protected String nodeLinkStrategy; + private @Setter @Getter @Inject @Autowired LogStorage debugStorage; + private @Setter @Getter @Inject @Autowired List metadataNames; + private Map metadataFilter; + private List checkpointMatchers; + private BeanParent beanParent; + private Echo2Application echo2Application; + private @Inject @Autowired MetadataExtractor metadataExtractor; + + protected enum NodeLinkStrategy { + PATH, + CHECKPOINT_NUMBER, + NONE + } + + public void setName(String name) { + this.name = name; + } + + public String getName() { + return name; + } + + public void setNodeLinkStrategy(String nodeLinkStrategy) { + this.nodeLinkStrategy = nodeLinkStrategy; + } + + public String getNodeLinkStrategy() { + if (nodeLinkStrategy == null) { + return NodeLinkStrategy.PATH.toString(); + } + return nodeLinkStrategy; + } + + public void setMetadataFilter(Map metadataFilter) { + this.metadataFilter = metadataFilter; + } + + public Map getMetadataFilter() { + return metadataFilter; + } + + public void setCheckpointMatchers(List checkpointMatchers) { + this.checkpointMatchers = checkpointMatchers; + } + + /** + * @see nl.nn.testtool.echo2.Echo2Application#initBean() + */ + public void initBean(BeanParent beanParent) { + this.beanParent = beanParent; + this.echo2Application = Echo2Application.getEcho2Application(beanParent, this); + } + + public BeanParent getBeanParent() { + return beanParent; + } + + public Echo2Application getEcho2Application() { + return echo2Application; + } + + public String isOpenReportAllowed(Object StorageId) { + return ReportsComponent.OPEN_REPORT_ALLOWED; + } + + public boolean showCheckpoint(Report report, Checkpoint checkpoint) { + boolean match = false; + if (checkpointMatchers == null) { + match = true; + } + for (int i = 0; !match && i < checkpointMatchers.size(); i++) { + CheckpointMatcher checkpointMatcher = checkpointMatchers.get(i); + match = checkpointMatcher.match(report, checkpoint); + } + return match; + } + + public String toString() { + return getName(); + } + + public Map toHashMap(boolean isDefaultView) { + Map metadataTypes = new HashMap<>(); + for (String metadataName : getMetadataNames()) { + metadataTypes.put(metadataName, metadataExtractor.getType(metadataName)); + } + + return new HashMap() {{ + put("storageName", debugStorage.getName()); + put("defaultView", isDefaultView); + put("metadataNames", metadataNames); + put("metadataLabels", getMetadataLabels()); + put("crudStorage", debugStorage instanceof CrudStorage); + put("nodeLinkStrategy", nodeLinkStrategy); + put("name", getName()); + put("metadataTypes", metadataTypes); + }}; + } + + public List getMetadataLabels() { + List metadataLabels = new ArrayList<>(); + for (String metadataName : getMetadataNames()) { + metadataLabels.add(metadataExtractor.getLabel(metadataName)); + } + + return metadataLabels; + } }