All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.vmlens.report.description.DescriptionContextImpl Maven / Gradle / Ivy

package com.vmlens.report.description;


import com.vmlens.report.container.ContainerForField;
import com.vmlens.report.container.ContainerForMethod;
import com.vmlens.report.container.ContainerForTestLoop;
import com.vmlens.report.container.ContainerForThread;
import com.vmlens.report.element.LoopRunAndThreadIndex;

import java.util.Map;

public class DescriptionContextImpl implements DescriptionContext {

    private final ContainerMapAdapter threadNames;
    private final ContainerMapAdapter methodNames;
    private final ContainerMapAdapter fieldNames;
    private final ContainerMapAdapter loopNames;

    public DescriptionContextImpl(Map indexToThreadDescription,
                                  Map idToMethodContainer,
                                  Map idToFieldContainer,
                                  Map idToTestLoopDescription) {
        this.threadNames = new ContainerMapAdapter<>(indexToThreadDescription);
        this.methodNames = new ContainerMapAdapter<>(idToMethodContainer);
        this.fieldNames = new ContainerMapAdapter<>(idToFieldContainer);
        this.loopNames = new ContainerMapAdapter<>(idToTestLoopDescription);
    }

    @Override
    public String threadName(LoopRunAndThreadIndex key) {
        return threadNames.getName(key);
    }

    public String methodName(Integer key) {
        return methodNames.getName(key);
    }

    public String fieldName(Integer key) {
        return fieldNames.getName(key);
    }

    public String loopName(Integer key) {
        return loopNames.getName(key);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy