Namespace: OpenEdge.Core
Type: Class SemanticVersion
Parent Classes:
Progress.Lang.Object

Inherits: Progress.Lang.Object


/* *************************************************************************************************************************
Copyright (c) 2017-2018, 2021-2022 by Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved.
File:SemanticVersion
Purpose:A semantic version representation. A semver is
MAJOR.MINOR.PATCH-PRERELEASE+BUILDMETADATA
where the prerelease part is optional.
The MAJOR, MINOR and PATCH releases are integer values.
The PRERELEASE is a string/character
The BUILDMETADATA is a string/characaer
The delimiters ("." / "-" / "+") are not stored in the object
Author(s):pjudge
Created:2017-09-05
Notes:* From http://semver.org/spec/v2.0.0.html
/* The major version



Method Summary
  Options Name Purpose
  INTEGER CompareTo (SemanticVersion) /* Comparison method, used by SortedSet's default comparer - used specs from https://semver.org/spec/v2.0.0.html to do compare - per the spec, "Build metadata MUST be ignored when determining version precedence. Thus two versions that differ only in the build metadata, have the same precedence.", so it just sorts mormally. - If the returned value is less than 0 (zero), then the current object sorts before the object passed in. - If the returned value equals 0 (zero) , then the current object occupies the same position in the sort order. - If the returned value is greater than 0(zero), then the current object sorts after the object passed in. - If either object's Value is the unknown value (?), then that sorts high/early/before @param SemanticVersion The object to compare to. @return integer 0 = same object +1 = sorts after -1 = sorts before */
  LOGICAL Equals (Object)
  OpenEdge.Core.SemanticVersion Parse (character) /* Parses a version string and returns a SemanticVerison object @param character An appropriately-formatted version string @return SemanticVersion A SemanticVersion object */
  CHARACTER ToString ()

Constructor Summary
  Options Name Purpose
  SemanticVersion () /* Default constructor */
  SemanticVersion (integer, integer, integer) /* Constructor @param integer The major version; must be >= 0 @param integer The minor version; must be >= 0 @param integer The patch version; must be >= 0 */
  SemanticVersion (integer, integer, integer, character) /* Constructor @param integer The major version; must be >= 0 @param integer The minor version; must be >= 0 @param integer The patch version; must be >= 0 @param character the prelease version; must be non-null */
  SemanticVersion (integer, integer, integer, character, character) /* Constructor @param integer The major version; must be >= 0 @param integer The minor version; must be >= 0 @param integer The patch version; must be >= 0 @param character the prelease version; must be non-null @param character build metadata ; must be non-null */

Property Summary
  Options Name Purpose
  CHARACTER BuildMetadata
  INTEGER Major
  INTEGER Minor
  INTEGER Patch
  CHARACTER Prerelease


Method Detail
Top

INTEGER CompareTo (SemanticVersion)

/* Comparison method, used by SortedSet's default comparer
- used specs from https://semver.org/spec/v2.0.0.html to do compare
- per the spec, "Build metadata MUST be ignored when determining version precedence. Thus two versions
that differ only in the build metadata, have the same precedence.", so it just
sorts mormally.
- If the returned value is less than 0 (zero), then the current object sorts before the object passed in.
- If the returned value equals 0 (zero) , then the current object occupies the same position in the sort order.
- If the returned value is greater than 0(zero), then the current object sorts after the object passed in.
- If either object's Value is the unknown value (?), then that sorts high/early/before
+1 = sorts after
-1 = sorts before
Parameters:
pOther OpenEdge.Core.SemanticVersion
 
Returns INTEGER
  integer 0 = same object
Top

LOGICAL Equals (Object)

Parameters:
pCompare Progress.Lang.Object
 
Returns LOGICAL
 
Top

OpenEdge.Core.SemanticVersion Parse (character)

/* Parses a version string and returns a SemanticVerison object
Parameters:
pVersion CHARACTER
 
Returns OpenEdge.Core.SemanticVersion
  SemanticVersion A SemanticVersion object
Top

CHARACTER ToString ()

Returns CHARACTER
 


Constructor Detail
Top

SemanticVersion ()

/* Default constructor
Top

SemanticVersion (integer, integer, integer)

/* Constructor
Parameters:
pMajor INTEGER
 
pMinor INTEGER
 
pPatch INTEGER
 
Top

SemanticVersion (integer, integer, integer, character)

/* Constructor
Parameters:
pMajor INTEGER
 
pMinor INTEGER
 
pPatch INTEGER
 
pPreRel CHARACTER
 
Top

SemanticVersion (integer, integer, integer, character, character)

/* Constructor
Parameters:
pMajor INTEGER
 
pMinor INTEGER
 
pPatch INTEGER
 
pPreRel CHARACTER
 
pBuildMeta CHARACTER
 


Property Detail
Top

CHARACTER BuildMetadata

Returns CHARACTER
 
Top

INTEGER Major

Returns INTEGER
 
Top

INTEGER Minor

Returns INTEGER
 
Top

INTEGER Patch

Returns INTEGER
 
Top

CHARACTER Prerelease

Returns CHARACTER