/** * Convert <code>version</code> into its OSGi equivalent if possible. * * @param version The version to convert. Can be <code>null</code> * @return The converted version or <code>null</code> if the argument was <code>null</code> * @throws UnsupportedOperationException if the version could not be converted into an OSGi version */ public static org.osgi.framework.Version toOSGiVersion(Version version) { if (version == null) return null; if (version == Version.emptyVersion) return org.osgi.framework.Version.emptyVersion; if (version == Version.MAX_VERSION) return new org.osgi.framework.Version(Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE); BasicVersion bv = (BasicVersion) version; return new org.osgi.framework.Version(bv.getMajor(), bv.getMinor(), bv.getMicro(), bv.getQualifier()); }
/** * Convert <code>version</code> into its OSGi equivalent if possible. * * @param version The version to convert. Can be <code>null</code> * @return The converted version or <code>null</code> if the argument was <code>null</code> * @throws UnsupportedOperationException if the version could not be converted into an OSGi version */ public static org.osgi.framework.Version toOSGiVersion(Version version) { if (version == null) return null; if (version == Version.emptyVersion) return org.osgi.framework.Version.emptyVersion; if (version == Version.MAX_VERSION) return new org.osgi.framework.Version(Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE); BasicVersion bv = (BasicVersion) version; return new org.osgi.framework.Version(bv.getMajor(), bv.getMinor(), bv.getMicro(), bv.getQualifier()); }
/** * Convert <code>version</code> into its OSGi equivalent if possible. * * @param version The version to convert. Can be <code>null</code> * @return The converted version or <code>null</code> if the argument was <code>null</code> * @throws UnsupportedOperationException if the version could not be converted into an OSGi version */ public static org.osgi.framework.Version toOSGiVersion(Version version) { if (version == null) return null; if (version == Version.emptyVersion) return org.osgi.framework.Version.emptyVersion; if (version == Version.MAX_VERSION) return new org.osgi.framework.Version(Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE); BasicVersion bv = (BasicVersion) version; return new org.osgi.framework.Version(bv.getMajor(), bv.getMinor(), bv.getMicro(), bv.getQualifier()); }
/** * Convert <code>version</code> into its OSGi equivalent if possible. * * @param version The version to convert. Can be <code>null</code> * @return The converted version or <code>null</code> if the argument was <code>null</code> * @throws UnsupportedOperationException if the version could not be converted into an OSGi version */ public static org.osgi.framework.Version toOSGiVersion(Version version) { if (version == null) return null; if (version == Version.emptyVersion) return org.osgi.framework.Version.emptyVersion; if (version == Version.MAX_VERSION) return new org.osgi.framework.Version(Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE); BasicVersion bv = (BasicVersion) version; return new org.osgi.framework.Version(bv.getMajor(), bv.getMinor(), bv.getMicro(), bv.getQualifier()); }