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

com.yahoo.vespa.model.application.validation.ImportPackageInfo Maven / Gradle / Ivy

There is a newer version: 8.409.18
Show newest version
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.model.application.validation;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

/**
 * @author baldersheim
 */
public class ImportPackageInfo {
    private static final String VERSION = "version";
    private final List packages;
    public ImportPackageInfo(String importPackage) {
        List packages = new ArrayList<>();
        List tokens = new TokenizeAndDeQuote(";,=", "\"'").tokenize(importPackage);
        for (int i = 0; i < tokens.size(); ++i) {
            String token = tokens.get(i);
            if (VERSION.equals(token)) {
                ++i; // skip the optional version
            } else {
                packages.add(token);
            }
        }
        this.packages = List.copyOf(packages);
    }
    Collection packages() { return packages; }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy