org.opencastproject.kernel.bundleinfo.BundleInfoImpl Maven / Gradle / Ivy
/*
* Licensed to The Apereo Foundation under one or more contributor license
* agreements. See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
*
* The Apereo Foundation licenses this file to you under the Educational
* Community License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of the License
* at:
*
* http://opensource.org/licenses/ecl2.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*
*/
package org.opencastproject.kernel.bundleinfo;
import static org.opencastproject.util.data.Option.none;
import org.opencastproject.util.data.Option;
public class BundleInfoImpl implements BundleInfo {
private final String host;
private final String bundleSymbolicName;
private final long bundleId;
private final String bundleVersion;
private final Option buildNumber;
private final Option dbSchemaVersion;
private final BundleVersion version;
public BundleInfoImpl(String host, String bundleSymbolicName, long bundleId, String bundleVersion,
Option buildNumber, Option dbSchemaVersion) {
this.host = host;
this.bundleSymbolicName = bundleSymbolicName;
this.bundleId = bundleId;
this.bundleVersion = bundleVersion;
this.buildNumber = buildNumber;
this.dbSchemaVersion = dbSchemaVersion;
this.version = new BundleVersion(bundleVersion, buildNumber);
}
public static BundleInfo bundleInfo(String host, String bundleSymbolicName, long bundleId, String bundleVersion,
Option buildNumber) {
return new BundleInfoImpl(host, bundleSymbolicName, bundleId, bundleVersion, buildNumber, none(""));
}
public static BundleInfo bundleInfo(String host, String bundleSymbolicName, long bundleId, String bundleVersion,
Option buildNumber, Option dbSchemaVersion) {
return new BundleInfoImpl(host, bundleSymbolicName, bundleId, bundleVersion, buildNumber, dbSchemaVersion);
}
@Override
public String getHost() {
return host;
}
@Override
public String getBundleSymbolicName() {
return bundleSymbolicName;
}
@Override
public long getBundleId() {
return bundleId;
}
@Override
public String getBundleVersion() {
return bundleVersion;
}
@Override
public Option getBuildNumber() {
return buildNumber;
}
@Override
public BundleVersion getVersion() {
return version;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy