Class SchemaVersionMapper
java.lang.Object
org.cyclonedx.gradle.model.SchemaVersionMapper
One-way mapper from Core's
Version to the plugin-internal SchemaVersion. Only the two
version-conditional decision points in SbomBuilder.buildMetadata() need this translation; every other use
of Version in the plugin (hash calculation, BOM serialization/validation, the schema-version CLI/DSL
mapping in CyclonedxUtils.schemaVersion(String)) keeps using the Core type directly and is untouched by
this class.-
Method Summary
Modifier and TypeMethodDescriptionstatic SchemaVersionfrom(org.cyclonedx.Version coreVersion) Maps a CoreVersionto the correspondingSchemaVersion.
-
Method Details
-
from
Maps a CoreVersionto the correspondingSchemaVersion.Comparisons are ordinal, mirroring the
Version.compareTo(...)checks this type replaces, so a genuinely unknown futureVersionconstant (newer thanVersion.VERSION_17) is never rejected — it falls back to the newest known schema's thresholds (SchemaVersion.VERSION_17), staying exactly as permissive as the rawcompareTologic it replaces.- Parameters:
coreVersion- the Core schema version to translate- Returns:
- the corresponding internal
SchemaVersion
-