Example usage for com.google.common.collect LinkedListMultimap create

List of usage examples for com.google.common.collect LinkedListMultimap create

Introduction

In this page you can find the example usage for com.google.common.collect LinkedListMultimap create.

Prototype

public static <K, V> LinkedListMultimap<K, V> create() 

Source Link

Document

Creates a new, empty LinkedListMultimap with the default initial capacity.

Usage

From source file:org.sonar.plugins.groovy.codenarc.CodeNarcSourceAnalyzer.java

private Multimap<File, FileResults> processFiles(RuleSet ruleSet) {
    Multimap<File, FileResults> results = LinkedListMultimap.create();
    for (File file : sourceFiles) {
        List<Violation> violations = collectViolations(new SourceFile(file), ruleSet);
        violationsByFile.put(file, violations);
        FileResults result = new FileResults(file.getAbsolutePath(), violations);
        results.put(file.getParentFile(), result);
    }/*from   w  ww  .j  a v  a2s .  co  m*/
    return results;
}

From source file:com.epam.reportportal.extension.bugtracking.InternalTicketAssembler.java

@Override
public InternalTicket apply(PostTicketRQ input) {
    InternalTicket ticket = new InternalTicket();

    if (null != input.getFields()) {
        Multimap<String, String> fieldsMultimap = LinkedListMultimap.create();
        for (PostFormField field : input.getFields()) {
            fieldsMultimap.putAll(field.getId(), field.getValue());
        }/*from ww  w  .ja v a  2 s .c o m*/
        ticket.setFields(fieldsMultimap);
    }

    if (input.getIsIncludeLogs() || input.getIsIncludeScreenshots()) {
        List<Log> logs = logRepository.findByTestItemRef(input.getTestItemId(),
                0 == input.getNumberOfLogs() ? Integer.MAX_VALUE : input.getNumberOfLogs(),
                input.getIsIncludeScreenshots());
        List<InternalTicket.LogEntry> entries = new ArrayList<>(logs.size());
        for (Log log : logs) {
            BinaryData attachment = null;
            /* Get screenshots if required and they are present */
            if (null != log.getBinaryContent() && input.getIsIncludeScreenshots()) {
                attachment = dataStorage.fetchData(log.getBinaryContent().getBinaryDataId());
            }
            /* Forwarding enabled logs boolean if screens only required */
            entries.add(new InternalTicket.LogEntry(log, attachment, input.getIsIncludeLogs()));
        }
        ticket.setLogs(entries);
    }

    if (input.getIsIncludeComments()) {
        TestItem testItem = itemRepository.findOne(input.getTestItemId());
        if (null != testItem.getIssue().getIssueDescription())
            ticket.setComments(testItem.getIssue().getIssueDescription());
    }

    if (!CommonPredicates.IS_MAP_EMPTY.test(input.getBackLinks())) {
        ticket.setBackLinks(ImmutableMap.copyOf(input.getBackLinks()));
    }
    return ticket;
}

From source file:com.isotrol.impe3.core.component.QueryExtractors.java

/**
 * Performs an extraction.// w w w .  java  2  s. c  om
 * @param target Target object.
 * @return Destination multimap.
 */
public final Multimap<String, String> extract(Object target) {
    final Multimap<String, String> map = LinkedListMultimap.create();
    for (QueryExtractor e : extractors) {
        e.extract(target, map);
    }
    extractTo(target, map);
    return map;
}

From source file:com.isotrol.impe3.core.component.HeaderExtractors.java

/**
 * Performs an extraction./*w w w .  j ava2 s .com*/
 * @param target Target object.
 * @param map Destination multimap.
 */
public final Multimap<String, String> extract(Object target) {
    final Multimap<String, String> map = LinkedListMultimap.create();
    for (HeaderExtractor e : extractors) {
        e.extract(target, map);
    }
    extractTo(target, map);
    return map;
}

From source file:org.opendaylight.mdsal.dom.broker.DOMRpcRoutingTable.java

private static ListMultimap<SchemaPath, YangInstanceIdentifier> decomposeIdentifiers(
        final Set<DOMRpcIdentifier> rpcs) {
    final ListMultimap<SchemaPath, YangInstanceIdentifier> ret = LinkedListMultimap.create();
    for (DOMRpcIdentifier i : rpcs) {
        ret.put(i.getType(), i.getContextReference());
    }/*from ww  w  .  jav  a  2  s . co  m*/
    return ret;
}

From source file:uapi.service.internal.ServiceHolder.java

ServiceHolder(final String from, final Object service, final String serviceId, final Dependency[] dependencies,
        final ISatisfyHook satisfyHook) {
    ArgumentChecker.notNull(from, "from");
    ArgumentChecker.notNull(service, "service");
    ArgumentChecker.notEmpty(serviceId, "serviceId");
    ArgumentChecker.notNull(dependencies, "dependencies");
    ArgumentChecker.notNull(satisfyHook, "satisfyHook");
    this._svc = service;
    this._svcId = serviceId;
    this._from = from;
    this._qualifiedSvcId = new QualifiedServiceId(serviceId, from);
    this._satisfyHook = satisfyHook;
    this._dependencies = LinkedListMultimap.create();
    this._stateMonitors = new LinkedList<>();

    Observable.from(dependencies).subscribe(dependency -> this._dependencies.put(dependency, null));

    // Create StateMonitor here since it need read dependencies information.
    this._stateManagement = new StateManagement();
}

From source file:com.xebia.os.maven.couchdocsplugin.LocalDocumentsSelector.java

/**
 * Finds the local documents for processing.
 * @return keys: database name, values: unloaded {@code LocalDocument}s.
 */// w  w w. ja  v  a2  s  . c  om
public Multimap<String, LocalDocument> select() throws IOException {
    if (!baseDir.isDirectory() || !baseDir.canRead()) {
        throw new FileNotFoundException(
                "The path " + baseDir.getPath() + " doesn't exist, is not a directory, or is not readable.");
    }
    Multimap<String, LocalDocument> result = LinkedListMultimap.create();
    DirectoryScanner scanner = new DirectoryScanner();
    scanner.addDefaultExcludes();
    scanner.setBasedir(baseDir);
    scanner.setIncludes(includes);
    scanner.setExcludes(excludes);
    scanner.scan();
    for (String file : scanner.getIncludedFiles()) {
        String databaseName = new File(file).getParent();
        if (databaseName != null) {
            String cleanDatabaseName = sanifyDatabaseName(databaseName);
            if (cleanDatabaseName != null) {
                log.debug("Found document " + file + " in database " + cleanDatabaseName);
                result.put(cleanDatabaseName, new LocalDocument(new File(baseDir, file)));
            } else {
                log.warn("Ignoring document " + file + " because \"" + databaseName
                        + "\" is an invalid Couch database name.");
            }
        } else {
            log.debug("Ingoring document " + file + " in database null");
        }
    }
    return result;
}

From source file:ch.bbv.fsm.impl.internal.statemachine.transition.TransitionDictionaryImpl.java

/**
 * Creates a new instance./*from  ww  w . j  a  va 2s  .com*/
 * 
 * @param state
 *            the internalState this transitions belong to.
 */
public TransitionDictionaryImpl(final InternalStateImpl<TStateMachine, TState, TEvent> state) {
    this.internalState = state;
    this.transitions = LinkedListMultimap.create();
}

From source file:com.github.nmorel.gwtjackson.guava.client.deser.LinkedListMultimapJsonDeserializer.java

@Override
protected LinkedListMultimap<K, V> newMultimap() {
    return LinkedListMultimap.create();
}

From source file:org.invenzzia.opentrans.visitons.render.SceneManager.java

public SceneManager() {
    this.lock = new ReentrantLock();
    this.scene = new LinkedHashMap<>();
    this.listeners = LinkedListMultimap.create();
}