All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.teamscale.core.migration.ETeamscaleVersion Maven / Gradle / Ivy

There is a newer version: 2025.1.0
Show newest version
/*-------------------------------------------------------------------------+
|                                                                          |
| Copyright 2005-2011 the ConQAT Project                                   |
|                                                                          |
| Licensed under the Apache License, Version 2.0 (the "License");          |
| you may not use this file except in compliance with the License.         |
| You may obtain a copy of the License at                                  |
|                                                                          |
|    http://www.apache.org/licenses/LICENSE-2.0                            |
|                                                                          |
| Unless required by applicable law or agreed to in writing, software      |
| distributed under the License is distributed on an "AS IS" BASIS,        |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and      |
| limitations under the License.                                           |
+-------------------------------------------------------------------------*/
package com.teamscale.core.migration;

import static java.util.Arrays.stream;

import java.util.Optional;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.conqat.lib.commons.version.Version;

import com.google.common.base.Preconditions;

/**
 * Enumeration with all released versions of Teamscale.
 */
public enum ETeamscaleVersion {

	/** Version 1.0 released on January, 30th 2014. */
	VERSION_1_0_0,

	/** Version 1.1 released on April, 8th 2014. */
	VERSION_1_1_0,

	/** Version 1.1.1 released on April, 11th 2014. */
	VERSION_1_1_1,

	/** Version 1.2 released on July, 4th 2014. */
	VERSION_1_2_0,

	/** Version 1.2.1 released on July, 17th 2014. */
	VERSION_1_2_1,

	/** Version 1.3 released on October, 10th 2014. */
	VERSION_1_3_0,

	/** Version 1.3.1 released on October, 17th 2014. */
	VERSION_1_3_1,

	/** Version 1.3.2 released on December, 11th 2014. */
	VERSION_1_3_2,

	/** Version 1.4 released on March, 13th 2015. */
	VERSION_1_4_0,

	/** Version 1.5 released on July, 3rd 2015. */
	VERSION_1_5_0,

	/** Version 1.5.1 released on August, 21st 2015. */
	VERSION_1_5_1,

	/** Version 1.6 released on October, 9th 2015. */
	VERSION_1_6_0,

	/** Version 1.6.1 released on December, 17th 2015. */
	VERSION_1_6_1,

	/** Version 1.6.2 released on January, 26th 2016. */
	VERSION_1_6_2,

	/** Version 2.0 released on February, 26th 2016. */
	VERSION_2_0_0,

	/** Version 2.0.1 released on March, 16th 2016. */
	VERSION_2_0_1,

	/** Version 2.0.2 released on April, 26th 2016. */
	VERSION_2_0_2,

	/** Version 2.0.3 released on May, 25th 2016. */
	VERSION_2_0_3,

	/** Version 2.0.4 released on June, 7th 2016. */
	VERSION_2_0_4,

	/** Version 2.0.5 released on July, 11th 2016. */
	VERSION_2_0_5,

	/** Version 2.0.6 released on August, 4th 2016. */
	VERSION_2_0_6,

	/** Version 3.0 released on December, 21st 2016. */
	VERSION_3_0_0,

	/** Version 3.0.1 released on January, 31th 2017. */
	VERSION_3_0_1,

	/** Version 3.0.2 released on January, 20th 2017. */
	VERSION_3_0_2,

	/** Version 3.0.3 released on January, 27th 2017. */
	VERSION_3_0_3,

	/** Version 3.1 released on February, 1st 2017. */
	VERSION_3_1_0,

	/** Version 3.1.1 released on February, 8th 2017. */
	VERSION_3_1_1,

	/** Version 3.1.2 released on February, 15th 2017. */
	VERSION_3_1_2,

	/** Version 3.1.3 released on February, 22th 2017. */
	VERSION_3_1_3,

	/** Version 3.1.4 released on March, 8th 2017. */
	VERSION_3_1_4,

	/** Version 3.1.5 released on March, 9th 2017. */
	VERSION_3_1_5,

	/** Version 3.2.0 released on February, 22th 2017. */
	VERSION_3_2_0,

	/** Version 3.2.1 released on March, 22th 2017. */
	VERSION_3_2_1,

	/** Version 3.2.2 released on March, 29th 2017. */
	VERSION_3_2_2,

	/** Version 3.2.3 released on April, 5th 2017. */
	VERSION_3_2_3,

	/** Version 3.2.4 released on April, 12th 2017. */
	VERSION_3_2_4,

	/** Version 3.2.5 released on April, 19th 2017. */
	VERSION_3_2_5,

	/** Version 3.2.6 released on April, 26th 2017. */
	VERSION_3_2_6,

	/** Released on May 10, 2017. */
	VERSION_3_2_7,

	/** Released April 26, 2017. */
	VERSION_3_3_0,

	/** Released May 3, 2017. */
	VERSION_3_3_1,

	/** Released May 10, 2017. */
	VERSION_3_3_2,

	/** Released May 17, 2017. */
	VERSION_3_3_3,

	/** Released May 24, 2017. */
	VERSION_3_3_4,

	/** Released May 31, 2017. */
	VERSION_3_3_5,

	/** Released June 6, 2017. */
	VERSION_3_4_0,

	/** Released June 13, 2017. */
	VERSION_3_4_1,

	/** Released June 27, 2017. */
	VERSION_3_4_2,

	/** Released June 28, 2017. */
	VERSION_3_4_3,

	/** Released June 30, 2017. */
	VERSION_3_4_4,

	/** Released July 4, 2017. */
	VERSION_3_4_5,

	/** Released July 6, 2017. */
	VERSION_3_4_6,

	/** Released July 11, 2017. */
	VERSION_3_4_7,

	/** Released July 18, 2017. */
	VERSION_3_4_8,

	/** Released July 25, 2017. */
	VERSION_3_4_9,

	/** Released August 1, 2017. */
	VERSION_3_4_10,

	/** Released July 18, 2017. */
	VERSION_3_5_0,

	/** Released July 24, 2017. */
	VERSION_3_5_1,

	/** Released August 1, 2017. */
	VERSION_3_5_2,

	/** Released August 7, 2017. */
	VERSION_3_5_3,

	/** Released August 16, 2017. */
	VERSION_3_5_4,

	/** Released August 22, 2017. */
	VERSION_3_5_5,

	/** Released August 25, 2017. */
	VERSION_3_5_6,

	/** Released August 29, 2017 */
	VERSION_3_6_0,

	/** Released September 25, 2017 */
	VERSION_3_6_1,

	/** Release October 10, 2017 */
	VERSION_3_6_2,

	/** Released October 10, 2017 */
	VERSION_3_7_0,

	/** Released October 12, 2017 */
	VERSION_3_7_1,

	/** Released October 20, 2017 */
	VERSION_3_7_2,

	/** Released November 3, 2017 */
	VERSION_3_7_3,

	/** Released November 16, 2017 */
	VERSION_3_7_4,

	/** Released November 28, 2017 */
	VERSION_3_7_5,

	/** Released November 29, 2017 */
	VERSION_3_7_6,

	/** Released November 21, 2017 */
	VERSION_3_8_0,

	/** Released November 30, 2017 */
	VERSION_3_8_1,

	/** Released December 6, 2017 */
	VERSION_3_8_2,

	/** Released December 12, 2017 */
	VERSION_3_8_3,

	/** Released December 19, 2017 */
	VERSION_3_8_4,

	/** Released February 6, 2018 */
	VERSION_3_8_5,

	/** Released February 13, 2018 */
	VERSION_3_8_6,

	/** Released January 9, 2018 */
	VERSION_3_9_0,

	/** Released January 16, 2018 */
	VERSION_3_9_1,

	/** Released January 25, 2018 */
	VERSION_3_9_2,

	/** Released February 6, 2018 */
	VERSION_3_9_3,

	/** Released February 13, 2018 */
	VERSION_3_9_4,

	/** Released February 20, 2018 */
	VERSION_3_9_5,

	/** Released March 7, 2018 */
	VERSION_3_9_6,

	/** Released February 13, 2018 */
	VERSION_4_0_0,

	/** Released February 20, 2018 */
	VERSION_4_0_1,

	/** Released February 27, 2018 */
	VERSION_4_0_2,

	/** Released March 7, 2018 */
	VERSION_4_0_3,

	/** Released March 20, 2018 */
	VERSION_4_0_4,

	/** Released March 28, 2018 */
	VERSION_4_0_5,

	/** Released April 5, 2018 */
	VERSION_4_1_0,

	/** Released April 11, 2018 */
	VERSION_4_1_1,

	/** Released April 17, 2018 */
	VERSION_4_1_2,

	/** Released April 26, 2018 */
	VERSION_4_1_3,

	/** Released May 8, 2018 */
	VERSION_4_1_4,

	/** Released May 29, 2018 */
	VERSION_4_1_5,

	/** Released May 14, 2018 */
	VERSION_4_2_0,

	/** Released May 22, 2018 */
	VERSION_4_2_1,

	/** Released May 29, 2018 */
	VERSION_4_2_2,

	/** Released June 5, 2018 */
	VERSION_4_2_3,

	/** Released June 12, 2018 */
	VERSION_4_2_4,

	/** Released June 20, 2018 */
	VERSION_4_2_5,

	/** Released June 26, 2018 */
	VERSION_4_2_6,

	/** Released June 29, 2018 */
	VERSION_4_2_7,

	/** Released July 17, 2018 */
	VERSION_4_2_8,

	/** Released June 26, 2018 */
	VERSION_4_3_0,

	/** Released June 29, 2018 */
	VERSION_4_3_1,

	/** Released July 3, 2018 */
	VERSION_4_3_2,

	/** Released July 10, 2018 */
	VERSION_4_3_3,

	/** Released July 17, 2018 */
	VERSION_4_3_4,

	/** Released July 24, 2018 */
	VERSION_4_3_5,

	/** Released July 31, 2018 */
	VERSION_4_3_6,

	/** Released July 31, 2018 */
	VERSION_4_4_0,

	/** Released August 7, 2018 */
	VERSION_4_4_1,

	/** Released August 14, 2018 */
	VERSION_4_4_2,

	/** Released August 28, 2018 */
	VERSION_4_4_3,

	/** Released August 31, 2018 */
	VERSION_4_4_4,

	/** Released September 4, 2018 */
	VERSION_4_4_5,

	/** Released September 11, 2018 */
	VERSION_4_4_6,

	/** Released September 20, 2018 */
	VERSION_4_4_7,

	/** Released October 1, 2018 */
	VERSION_4_4_8,

	/** Released September 11, 2018 */
	VERSION_4_5_0,

	/** Released September 18, 2018 */
	VERSION_4_5_1,

	/** Released September 20, 2018 */
	VERSION_4_5_2,

	/** Released September 25, 2018 */
	VERSION_4_5_3,

	/** Released September 26, 2018 */
	VERSION_4_5_4,

	/** Released October 1, 2018 */
	VERSION_4_5_5,

	/** Released October 9, 2018 */
	VERSION_4_5_6,

	/** Released October 16, 2018 */
	VERSION_4_5_7,

	/** Released October 30, 2018 */
	VERSION_4_5_8,

	/** Released November 20, 2018 */
	VERSION_4_5_9,

	/** Released October 23, 2018 */
	VERSION_4_6_0,

	/** Released October 30, 2018 */
	VERSION_4_6_1,

	/** Released November 5, 2018 */
	VERSION_4_6_2,

	/** Released November 20, 2018 */
	VERSION_4_6_3,

	/** Released November 27, 2018 */
	VERSION_4_6_4,

	/** Released December 4, 2018 */
	VERSION_4_6_5,

	/** Released December 11, 2018 */
	VERSION_4_6_6,

	/** Released January 8, 2019 */
	VERSION_4_6_7,

	/** Released April 2, 2019 */
	VERSION_4_6_8,

	/** Released December 4, 2018 */
	VERSION_4_7_0,

	/** Released December 11, 2018 */
	VERSION_4_7_1,

	/** Released December 18, 2018 */
	VERSION_4_7_2,

	/** Released January 8, 2019 */
	VERSION_4_7_3,

	/** Released January 15, 2019 */
	VERSION_4_7_4,

	/** Released January 22, 2019 */
	VERSION_4_7_5,

	/** Released January 29, 2019 */
	VERSION_4_7_6,

	/** Released February 19, 2019 */
	VERSION_4_7_7,

	/** Released January 29, 2019 */
	VERSION_4_8_0,

	/** Released February 5, 2019 */
	VERSION_4_8_1,

	/** Version 4.8.2 released February 12, 2019 */
	VERSION_4_8_2,

	/** Version 4.8.3 released February 19, 2019 */
	VERSION_4_8_3,

	/** Version 4.8.4 released February 26, 2019 */
	VERSION_4_8_4,

	/** Version 4.8.5 released March 5, 2019 */
	VERSION_4_8_5,

	/** Version 4.8.6 released March 12, 2019 */
	VERSION_4_8_6,

	/** Version 4.8.7 released March 19, 2019 */
	VERSION_4_8_7,

	/** Version 4.8.8 released April 2, 2019 */
	VERSION_4_8_8,

	/** Version 4.9.0 released February 26, 2019 */
	VERSION_4_9_0,

	/** Version 4.9.1 released February 27, 2019 */
	VERSION_4_9_1,

	/** Version 4.9.2 released March 5, 2019 */
	VERSION_4_9_2,

	/** Version 4.9.3 released March 7, 2019 */
	VERSION_4_9_3,

	/** Version 4.9.4 released March 12, 2019 */
	VERSION_4_9_4,

	/** Version 4.9.5 released March 19, 2019 */
	VERSION_4_9_5,

	/** Version 4.9.6 released March 26, 2019 */
	VERSION_4_9_6,

	/** Version 4.9.7 released April 2, 2019 */
	VERSION_4_9_7,

	/** Version 4.9.8 released April 9, 2019 */
	VERSION_4_9_8,

	/** Version 4.9.9 released April 15, 2019 */
	VERSION_4_9_9,

	/** Version 4.9.10 released April 23, 2019 */
	VERSION_4_9_10,

	/** Version 4.9.11 released April 30, 2019 */
	VERSION_4_9_11,

	/** Version 4.9.12 released May 7, 2019 */
	VERSION_4_9_12,

	/** Version 4.9.13 released May 21, 2019 */
	VERSION_4_9_13,

	/** Version 5.0.0 released April 9, 2019 */
	VERSION_5_0_0,

	/** Version 5.0.1 released April 15, 2019 */
	VERSION_5_0_1,

	/** Version 5.0.2 released April 23, 2019 */
	VERSION_5_0_2,

	/** Version 5.0.3 released April 30, 2019 */
	VERSION_5_0_3,

	/** Version 5.0.4 released May 7, 2019 */
	VERSION_5_0_4,

	/** Version 5.0.4 released May 14, 2019 */
	VERSION_5_0_5,

	/** Version 5.0.6 released May 21, 2019 */
	VERSION_5_0_6,

	/** Version 5.0.7 released May 28, 2019 */
	VERSION_5_0_7,

	/** Version 5.0.8 released June 4, 2019 */
	VERSION_5_0_8,

	/** Version 5.0.9 released June 11, 2019 */
	VERSION_5_0_9,

	/** Version 5.0.10 released June 18, 2019 */
	VERSION_5_0_10,

	/** Version 5.0.11 released June 25, 2019 */
	VERSION_5_0_11,

	/** Version 5.0.12 released July 9th, 2019 */
	VERSION_5_0_12,

	/** Version 5.0.13 released July 16th, 2019 */
	VERSION_5_0_13,

	/** Version 5.1.0 released May 21, 2019 */
	VERSION_5_1_0,

	/** Version 5.1.1 released May 28, 2019 */
	VERSION_5_1_1,

	/** Version 5.1.2 released June 4, 2019 */
	VERSION_5_1_2,

	/** Version 5.1.3 released June 11, 2019 */
	VERSION_5_1_3,

	/** Version 5.1.4 released June 18, 2019 */
	VERSION_5_1_4,

	/** Version 5.1.5 released June 25, 2019 */
	VERSION_5_1_5,

	/** Version 5.1.6 released July 2, 2019 */
	VERSION_5_1_6,

	/** Version 5.1.7 released July 9, 2019 */
	VERSION_5_1_7,

	/** Version 5.1.8 released July 16, 2019 */
	VERSION_5_1_8,

	/** Version 5.1.9 released July 23, 2019 */
	VERSION_5_1_9,

	/** Version 5.1.10 released July 30, 2019 */
	VERSION_5_1_10,

	/** Version 5.1.11 released August 6, 2019 */
	VERSION_5_1_11,

	/** Version 5.2.0 released July 2, 2019 */
	VERSION_5_2_0,

	/** Version 5.2.1 released July 9, 2019 */
	VERSION_5_2_1,

	/** Version 5.2.2 released July 16, 2019 */
	VERSION_5_2_2,

	/** Version 5.2.3 released July 23, 2019 */
	VERSION_5_2_3,

	/** Version 5.2.4 released July 30, 2019 */
	VERSION_5_2_4,

	/** Version 5.2.5 released August 6, 2019 */
	VERSION_5_2_5,

	/** Version 5.2.6 released August 13, 2019 */
	VERSION_5_2_6,

	/** Version 5.2.7 released August 20, 2019 */
	VERSION_5_2_7,

	/** Version 5.2.8 released August 27, 2019 */
	VERSION_5_2_8,

	/** Version 5.2.9 released September 3, 2019 */
	VERSION_5_2_9,

	/** Version 5.2.10 released September 10, 2019 */
	VERSION_5_2_10,

	/** Version 5.2.11 released September 17, 2019 */
	VERSION_5_2_11,

	/** Version 5.2.12 released September 24, 2019 */
	VERSION_5_2_12,

	/** Version 5.2.13 released October 1, 2019 */
	VERSION_5_2_13,

	/** Version 5.3.0 released August 13, 2019 */
	VERSION_5_3_0,

	/** Version 5.3.1 released August 20, 2019 */
	VERSION_5_3_1,

	/** Version 5.3.2 released August 27, 2019 */
	VERSION_5_3_2,

	/** Version 5.3.3 released September 3, 2019 */
	VERSION_5_3_3,

	/** Version 5.3.4 released September 10, 2019 */
	VERSION_5_3_4,

	/** Version 5.3.5 released September 17, 2019 */
	VERSION_5_3_5,

	/** Version 5.3.6 released September 24, 2019 */
	VERSION_5_3_6,

	/** Version 5.3.7 released October 1, 2019 */
	VERSION_5_3_7,

	/** Version 5.3.8 released October 8, 2019 */
	VERSION_5_3_8,

	/** Version 5.3.9 released October 15, 2019 */
	VERSION_5_3_9,

	/** Version 5.3.10 released October 22, 2019 */
	VERSION_5_3_10,

	/** Version 5.3.11 released October 29, 2019 */
	VERSION_5_3_11,

	/** Version 5.3.12 released November 5, 2019 */
	VERSION_5_3_12,

	/** Version 5.3.13 released November 19, 2019 */
	VERSION_5_3_13,

	/** Version 5.3.14 released November 26, 2019 */
	VERSION_5_3_14,

	/** Version 5.4.0 released September 24, 2019 */
	VERSION_5_4_0,

	/** Version 5.4.1 released October 1, 2019 */
	VERSION_5_4_1,

	/** Version 5.4.2 released October 8, 2019 */
	VERSION_5_4_2,

	/** Version 5.4.3 released October 15, 2019 */
	VERSION_5_4_3,

	/** Version 5.4.4 released October 22, 2019 */
	VERSION_5_4_4,

	/** Version 5.4.5 released October 29, 2019 */
	VERSION_5_4_5,

	/** Version 5.4.6 released November 5, 2019 */
	VERSION_5_4_6,

	/** Version 5.4.7 released November 12, 2019 */
	VERSION_5_4_7,

	/** Version 5.4.8 released November 19, 2019 */
	VERSION_5_4_8,

	/** Version 5.4.9 released November 26, 2019 */
	VERSION_5_4_9,

	/** Version 5.4.10 released December 3, 2019 */
	VERSION_5_4_10,

	/** Version 5.4.11 released January 14, 2019 */
	VERSION_5_4_11,

	/** Version 5.5.0 released November 5, 2019 */
	VERSION_5_5_0,

	/** Version 5.5.1 released November 12, 2019 */
	VERSION_5_5_1,

	/** Version 5.5.2 released November 19, 2019 */
	VERSION_5_5_2,

	/** Version 5.5.3 released November 26, 2019 */
	VERSION_5_5_3,

	/** Version 5.5.4 released December 3, 2019 */
	VERSION_5_5_4,

	/** Version 5.5.5 released December 10, 2019 */
	VERSION_5_5_5,

	/** Version 5.5.6 released December 17, 2019 */
	VERSION_5_5_6,

	/** Version 5.5.7 released January 7, 2020 */
	VERSION_5_5_7,

	/** Version 5.5.8 released January 14, 2020 */
	VERSION_5_5_8,

	/** Version 5.5.9 released January 21, 2020 */
	VERSION_5_5_9,

	/** Version 5.5.10 released January 28, 2020 */
	VERSION_5_5_10,

	/** Version 5.5.11 released February 4, 2020 */
	VERSION_5_5_11,

	/** Version 5.5.12 released February 11, 2020 */
	VERSION_5_5_12,

	/** Version 5.5.13 released March 3, 2020 */
	VERSION_5_5_13,

	/** Version 5.6.0 released December 17, 2019 */
	VERSION_5_6_0,

	/** Version 5.6.1 released January 7, 2020 */
	VERSION_5_6_1,

	/** Version 5.6.2 released January 14, 2020 */
	VERSION_5_6_2,

	/** Version 5.6.3 released January 21, 2020 */
	VERSION_5_6_3,

	/** Version 5.6.4 released January 28, 2020 */
	VERSION_5_6_4,

	/** Version 5.6.5 released February 4, 2020 */
	VERSION_5_6_5,

	/** Version 5.6.6 released February 11, 2020 */
	VERSION_5_6_6,

	/** Version 5.6.7 released February 18, 2020 */
	VERSION_5_6_7,

	/** Version 5.6.8 released February 25, 2020 */
	VERSION_5_6_8,

	/** Version 5.7.0 released January 28, 2020 */
	VERSION_5_7_0,

	/** Version 5.7.1 released February 4, 2020 */
	VERSION_5_7_1,

	/** Version 5.7.2 released February 11, 2020 */
	VERSION_5_7_2,

	/** Version 5.7.3 released February 18, 2020 */
	VERSION_5_7_3,

	/** Version 5.7.4 released February 25, 2020 */
	VERSION_5_7_4,

	/** Version 5.7.5 released March 3, 2020 */
	VERSION_5_7_5,

	/** Version 5.7.6 released March 10, 2020 */
	VERSION_5_7_6,

	/** Version 5.7.7 released March 17, 2020 */
	VERSION_5_7_7,

	/** Version 5.7.8 released March 24, 2020 */
	VERSION_5_7_8,

	/** Version 5.7.9 released March 31, 2020 */
	VERSION_5_7_9,

	/** Version 5.7.10 released April 7, 2020 */
	VERSION_5_7_10,

	/** Version 5.7.11 released April 14, 2020 */
	VERSION_5_7_11,

	/** Version 5.7.12 released April 28, 2020 */
	VERSION_5_7_12,

	/** Version 5.8.0 released March 10, 2020 */
	VERSION_5_8_0,

	/** Version 5.8.1 released March 17, 2020 */
	VERSION_5_8_1,

	/** Version 5.8.2 released March 24, 2020 */
	VERSION_5_8_2,

	/** Version 5.8.3 released March 31, 2020 */
	VERSION_5_8_3,

	/** Version 5.8.4 released April 7, 2020 */
	VERSION_5_8_4,

	/** Version 5.8.5 released April 14, 2020 */
	VERSION_5_8_5,

	/** Version 5.8.6 released April 21, 2020 */
	VERSION_5_8_6,

	/** Version 5.8.7 released April 28, 2020 */
	VERSION_5_8_7,

	/** Version 5.8.8 released May 5, 2020 */
	VERSION_5_8_8,

	/** Version 5.8.9 released May 12, 2020 */
	VERSION_5_8_9,

	/** Version 5.8.10 released May 19, 2020 */
	VERSION_5_8_10,

	/** Version 5.8.11 released May 26, 2020 */
	VERSION_5_8_11,

	/** Version 5.8.12 released June 2, 2020 */
	VERSION_5_8_12,

	/** Version 5.8.13 released June 30, 2020 */
	VERSION_5_8_13,

	/** Version 5.9.0 released April 21, 2020 */
	VERSION_5_9_0,

	/** Version 5.9.1 released April 28, 2020 */
	VERSION_5_9_1,

	/** Version 5.9.2 released May 5, 2020 */
	VERSION_5_9_2,

	/** Version 5.9.3 released May 12, 2020 */
	VERSION_5_9_3,

	/** Version 5.9.4 released May 19, 2020 */
	VERSION_5_9_4,

	/** Version 5.9.5 released May 26, 2020 */
	VERSION_5_9_5,

	/** Version 5.9.6 released June 2, 2020 */
	VERSION_5_9_6,

	/** Version 5.9.7 released June 9, 2020 */
	VERSION_5_9_7,

	/** Version 5.9.8 released June 16, 2020 */
	VERSION_5_9_8,

	/** Version 5.9.9 released June 23, 2020 */
	VERSION_5_9_9,

	/** Version 5.9.10 released June 30, 2020 */
	VERSION_5_9_10,

	/** Version 5.9.11 released July 7, 2020 */
	VERSION_5_9_11,

	/** Version 5.9.12 released July 9, 2020 */
	VERSION_5_9_12,

	/** Version 5.9.13 released July 14, 2020 */
	VERSION_5_9_13,

	/** Version 5.9.14 released July 21, 2020 */
	VERSION_5_9_14,

	/** Version 5.9.15 released July 28, 2020 */
	VERSION_5_9_15,

	/** Version 6.0.0 released June 9, 2020 */
	VERSION_6_0_0,

	/** Version 6.0.1 released June 16, 2020 */
	VERSION_6_0_1,

	/** Version 6.0.2 released June 23, 2020 */
	VERSION_6_0_2,

	/** Version 6.0.3 released June 30, 2020 */
	VERSION_6_0_3,

	/** Version 6.0.4 released July 8, 2020 */
	VERSION_6_0_4,

	/** Version 6.0.5 released July 9, 2020 */
	VERSION_6_0_5,

	/** Version 6.0.6 released July 14, 2020 */
	VERSION_6_0_6,

	/** Version 6.0.7 released July 21, 2020 */
	VERSION_6_0_7,

	/** Version 6.0.8 released July 28, 2020 */
	VERSION_6_0_8,

	/** Version 6.0.9 released August 4, 2020 */
	VERSION_6_0_9,

	/** Version 6.0.10 released August 11, 2020 */
	VERSION_6_0_10,

	/** Version 6.0.11 released August 18, 2020 */
	VERSION_6_0_11,

	/** Version 6.1.0 released July 14, 2020 */
	VERSION_6_1_0,

	/** Version 6.1.1 released July 21, 2020 */
	VERSION_6_1_1,

	/** Version 6.1.2 released July 28, 2020 */
	VERSION_6_1_2,

	/** Version 6.1.3 released August 4, 2020 */
	VERSION_6_1_3,

	/** Version 6.1.4 released August 11, 2020 */
	VERSION_6_1_4,

	/** Version 6.1.5 released August 18, 2020 */
	VERSION_6_1_5,

	/** Version 6.1.6 released August 25, 2020 */
	VERSION_6_1_6,

	/** Version 6.1.7 released September 1, 2020 */
	VERSION_6_1_7,

	/** Version 6.2.0 released August 25, 2020 */
	VERSION_6_2_0,

	/** Version 6.2.1 released September 1, 2020 */
	VERSION_6_2_1;

	/** The current version of Teamscale. */
	public static final ETeamscaleVersion CURRENT_VERSION = values()[values().length - 1];

	/** The minimum supported REST API version. */
	public static final ETeamscaleVersion MIN_SUPPORTED_API_VERSION = VERSION_5_7_0;

	/** The major version. */
	private final int major;

	/** The minor version. */
	private final int minor;

	/** The patch level. */
	private final int patch;

	/** Whether the version is already published. */
	private final boolean published;

	/**
	 * Need a separate holder class to access the {@link #NAME_PATTERN} inside
	 * {@link ETeamscaleVersion#ETeamscaleVersion(boolean)}.
	 */
	private static class Holder {

		private static final Pattern NAME_PATTERN = Pattern.compile("VERSION_(\\d+)_(\\d+)_(\\d+)");
	}

	ETeamscaleVersion() {
		this(true);
	}

	ETeamscaleVersion(boolean published) {
		Matcher namePattern = Holder.NAME_PATTERN.matcher(name());
		Preconditions.checkArgument(namePattern.matches());

		major = Integer.parseInt(namePattern.group(1));
		minor = Integer.parseInt(namePattern.group(2));
		patch = Integer.parseInt(namePattern.group(3));
		this.published = published;
	}

	/** @see #major */
	public int getMajor() {
		return major;
	}

	/** @see #minor */
	public int getMinor() {
		return minor;
	}

	/** @see #patch */
	public int getPatch() {
		return patch;
	}

	/** @see #published */
	public boolean isPublished() {
		return published;
	}

	/** Returns whether this is a feature release. */
	public boolean isFeatureRelease() {
		return patch == 0;
	}

	/**
	 * If this is the version of a patch release, returns the version of the
	 * preceding feature release. Otherwise, returns this version as is.
	 */
	public ETeamscaleVersion asFeatureRelease() {
		return stream(values()).filter(ETeamscaleVersion::isFeatureRelease) //
				.filter(version -> version.getMajor() == getMajor()) //
				.filter(version -> version.getMinor() == getMinor()) //
				.findAny().orElseThrow(AssertionError::new);
	}

	/** Returns the previous known version, if any. */
	public Optional previous() {
		if (ordinal() == 0) {
			return Optional.empty();
		}
		return Optional.of(values()[ordinal() - 1]);
	}

	/** Returns the next known version, if any. */
	public Optional next() {
		ETeamscaleVersion[] values = values();
		if (ordinal() == values.length - 1) {
			return Optional.empty();
		}
		return Optional.of(values[ordinal() + 1]);
	}

	@Override
	public String toString() {
		String result = major + "." + minor;
		if (patch > 0) {
			result += "." + patch;
		}
		return result;
	}

	/** Creates a new teamscale version object from the given enum literal. */
	public Version toVersionObject() {
		return new Version(major, minor, patch);
	}

	/**
	 * Returns the version as an integer metric by reserving two digits for each
	 * part.
	 */
	public int toMetric() {
		return (major * 100 + minor) * 100 + patch;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy