Package org.opends.server.tools.upgrade
Record Class UpgradeTaskVersion
java.lang.Object
java.lang.Record
org.opends.server.tools.upgrade.UpgradeTaskVersion
- Record Components:
- version- The- versionpart of the upgrade task version to create
- upgradeNumber- The number of the upgrade task version to create
- All Implemented Interfaces:
- Comparable<UpgradeTaskVersion>
public record UpgradeTaskVersion(com.forgerock.opendj.util.Version version, int upgradeNumber)
extends Record
implements Comparable<UpgradeTaskVersion>
Represents the version used for determining if the upgrade tool must be run and whether an upgrade task must run
 during the upgrade process.
 
 An upgrade task version is composed of a version plus the upgrade number.
 The upgrade number corresponds to the total number of upgrade tasks (without the mandatory ones)
 added since version 2.8.0 included.
 
Mandatory upgrade tasks are not taken into account in the upgrade number because:
- They are the latest to be registered, including them would have prevented us to use a counter to automatically assign a number to an upgrade task)
- They always run when an upgrade is needed
- The upgrade task number is not used for deciding whether an upgrade is needed, only to know if an upgrade task must run or not
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intInt constant to be used for versions when upgrade between builds was not supported (i.e older than 7.0.0).
- 
Constructor SummaryConstructorsConstructorDescriptionUpgradeTaskVersion(com.forgerock.opendj.util.Version version, int upgradeNumber) Creates an instance of aUpgradeTaskVersionrecord class.
- 
Method SummaryModifier and TypeMethodDescriptionintcompareTo(UpgradeTaskVersion other) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.toString()Returns a string representation of this record class.intReturns the value of theupgradeNumberrecord component.static UpgradeTaskVersionupgradeVersion(com.forgerock.opendj.util.Version version) Creates and returns a new upgrade version with no meaningful upgrade number.static UpgradeTaskVersionupgradeVersion(com.forgerock.opendj.util.Version version, int upgradeNumber) Creates and returns a new upgrade version set with provided parameters.com.forgerock.opendj.util.Versionversion()Returns the value of theversionrecord component.
- 
Field Details- 
UPGRADE_NUMBER_NOT_APPLICABLEpublic static final int UPGRADE_NUMBER_NOT_APPLICABLEInt constant to be used for versions when upgrade between builds was not supported (i.e older than 7.0.0).- See Also:
 
 
- 
- 
Constructor Details- 
UpgradeTaskVersionpublic UpgradeTaskVersion(com.forgerock.opendj.util.Version version, int upgradeNumber) Creates an instance of aUpgradeTaskVersionrecord class.- Parameters:
- version- the value for the- versionrecord component
- upgradeNumber- the value for the- upgradeNumberrecord component
 
 
- 
- 
Method Details- 
upgradeVersionCreates and returns a new upgrade version with no meaningful upgrade number.This method is used for compatibility with versions where upgrade number is not supported (versions older than 7.0.0). - Parameters:
- version- The- versionpart of the upgrade task version to create
- Returns:
- A new upgrade task versionwith no meaningful upgrade number
 
- 
upgradeVersionpublic static UpgradeTaskVersion upgradeVersion(com.forgerock.opendj.util.Version version, int upgradeNumber) Creates and returns a new upgrade version set with provided parameters.- Parameters:
- version- The- versionpart of the upgrade task version to create
- upgradeNumber- The number of the upgrade task version to create
- Returns:
- A new upgrade task version
 
- 
compareTo- Specified by:
- compareToin interface- Comparable<UpgradeTaskVersion>
 
- 
toStringReturns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
- 
hashCodepublic final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
- 
equalsIndicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='.
- 
versionpublic com.forgerock.opendj.util.Version version()Returns the value of theversionrecord component.- Returns:
- the value of the versionrecord component
 
- 
upgradeNumberpublic int upgradeNumber()Returns the value of theupgradeNumberrecord component.- Returns:
- the value of the upgradeNumberrecord component
 
 
-