Package org.opends.server.tools.upgrade
Record Class UpgradeTaskVersion
java.lang.Object
java.lang.Record
org.opends.server.tools.upgrade.UpgradeTaskVersion
- Record Components:
version
- Theversion
part of the upgrade task version to createupgradeNumber
- 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 Summary
Modifier and TypeFieldDescriptionstatic final int
Int constant to be used for versions when upgrade between builds was not supported (i.e older than 7.0.0). -
Constructor Summary
ConstructorDescriptionUpgradeTaskVersion
(com.forgerock.opendj.util.Version version, int upgradeNumber) Creates an instance of aUpgradeTaskVersion
record class. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(UpgradeTaskVersion other) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.toString()
Returns a string representation of this record class.int
Returns the value of theupgradeNumber
record component.static UpgradeTaskVersion
upgradeVersion
(com.forgerock.opendj.util.Version version) Creates and returns a new upgrade version with no meaningful upgrade number.static UpgradeTaskVersion
upgradeVersion
(com.forgerock.opendj.util.Version version, int upgradeNumber) Creates and returns a new upgrade version set with provided parameters.com.forgerock.opendj.util.Version
version()
Returns the value of theversion
record component.
-
Field Details
-
UPGRADE_NUMBER_NOT_APPLICABLE
public 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
-
UpgradeTaskVersion
public UpgradeTaskVersion(com.forgerock.opendj.util.Version version, int upgradeNumber) Creates an instance of aUpgradeTaskVersion
record class.- Parameters:
version
- the value for theversion
record componentupgradeNumber
- the value for theupgradeNumber
record component
-
-
Method Details
-
upgradeVersion
Creates 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
- Theversion
part of the upgrade task version to create- Returns:
- A new
upgrade task version
with no meaningful upgrade number
-
upgradeVersion
public static UpgradeTaskVersion upgradeVersion(com.forgerock.opendj.util.Version version, int upgradeNumber) Creates and returns a new upgrade version set with provided parameters.- Parameters:
version
- Theversion
part of the upgrade task version to createupgradeNumber
- The number of the upgrade task version to create- Returns:
- A new
upgrade task version
-
compareTo
- Specified by:
compareTo
in interfaceComparable<UpgradeTaskVersion>
-
toString
Returns 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. -
hashCode
public 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. -
equals
Indicates 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 '=='. -
version
public com.forgerock.opendj.util.Version version()Returns the value of theversion
record component.- Returns:
- the value of the
version
record component
-
upgradeNumber
public int upgradeNumber()Returns the value of theupgradeNumber
record component.- Returns:
- the value of the
upgradeNumber
record component
-