2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.velux.internal.utils;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.osgi.framework.FrameworkUtil;
19 * This is a helper class for dealing with information from MANIFEST file.
21 * It provides the following methods:
23 * <li>{@link #getBundleVersion} returns the bundle version as specified within the MANIFEST.</li>
27 * @author Guenther Schreiner - Initial contribution
30 public class ManifestInformation {
33 * ************************
34 * ***** Constructors *****
38 * Suppress default constructor for creating a non-instantiable class.
40 private ManifestInformation() {
41 throw new AssertionError();
44 // Class access methods
47 * Returns the bundle version as specified within the MANIFEST file.
49 * @return <B>bundleVersion</B> the resulted bundle version as {@link String}.
51 public static String getBundleVersion() {
52 String osgiBundleVersion = FrameworkUtil.getBundle(ManifestInformation.class).getBundleContext().getBundle()
54 return osgiBundleVersion;