aboutsummaryrefslogtreecommitdiffstats
path: root/jdisc_core/src/main/java/com/yahoo/jdisc/application/BsnVersion.java
blob: 2289df3a9c78bbbd59cceb63242f97c60902cf09 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.jdisc.application;

import org.osgi.framework.Bundle;
import org.osgi.framework.Version;

/**
 * A bundle's symbolic name and version.
 *
 * @author gjoranv
 */
public record BsnVersion(String symbolicName, Version version) {

    public BsnVersion(Bundle bundle) {
        this(bundle.getSymbolicName(), bundle.getVersion());
    }

    public String toReadableString() {
        return symbolicName + " version:" + version;
    }

}