-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #315 from drewbrokke/BLADE-738-BUG-v1-product-key-…
…comparator-to-send BLADE-738 Blade can not recognized "dxp-2023.q3.1" as a valid product key in product.json file.
- Loading branch information
Showing
12 changed files
with
359 additions
and
268 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
117 changes: 0 additions & 117 deletions
117
cli/src/main/java/com/liferay/blade/cli/command/validator/WorkspaceProductComparator.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
cli/src/main/java/com/liferay/blade/cli/util/ProductKeyInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/** | ||
* SPDX-FileCopyrightText: (c) 2023 Liferay, Inc. https://liferay.com | ||
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 | ||
*/ | ||
|
||
package com.liferay.blade.cli.util; | ||
|
||
import java.util.Comparator; | ||
|
||
/** | ||
* @author Drew Brokke | ||
*/ | ||
public class ProductKeyInfo implements Comparable<ProductKeyInfo> { | ||
|
||
@Override | ||
public int compareTo(final ProductKeyInfo keyInfo) { | ||
return Comparator.comparing( | ||
ProductKeyInfo::getProductRank | ||
).thenComparing( | ||
ProductKeyInfo::isQuarterly | ||
).thenComparing( | ||
ProductKeyInfo::getMajorProductKeyVersion | ||
).thenComparing( | ||
ProductKeyInfo::getMinorProductKeyVersion | ||
).thenComparing( | ||
ProductKeyInfo::getMicroProductKeyVersion | ||
).reversed( | ||
).compare( | ||
this, keyInfo | ||
); | ||
} | ||
|
||
public ProductKeyVersion getMajorProductKeyVersion() { | ||
return _majorProductKeyVersion; | ||
} | ||
|
||
public ProductKeyVersion getMicroProductKeyVersion() { | ||
return _microProductKeyVersion; | ||
} | ||
|
||
public ProductKeyVersion getMinorProductKeyVersion() { | ||
return _minorProductKeyVersion; | ||
} | ||
|
||
public String getProduct() { | ||
return _product; | ||
} | ||
|
||
public int getProductRank() { | ||
return _productRank; | ||
} | ||
|
||
public boolean isQuarterly() { | ||
return _quarterly; | ||
} | ||
|
||
public void setMajorProductKeyVersion(ProductKeyVersion majorProductKeyVersion) { | ||
_majorProductKeyVersion = majorProductKeyVersion; | ||
} | ||
|
||
public void setMicroProductKeyVersion(ProductKeyVersion microProductKeyVersion) { | ||
_microProductKeyVersion = microProductKeyVersion; | ||
} | ||
|
||
public void setMinorProductKeyVersion(ProductKeyVersion minorProductKeyVersion) { | ||
_minorProductKeyVersion = minorProductKeyVersion; | ||
} | ||
|
||
public void setProduct(String product) { | ||
_product = product; | ||
} | ||
|
||
public void setProductRank(int productRank) { | ||
_productRank = productRank; | ||
} | ||
|
||
public void setQuarterly(boolean quarterly) { | ||
_quarterly = quarterly; | ||
} | ||
|
||
private ProductKeyVersion _majorProductKeyVersion = ProductKeyVersion.BLANK; | ||
private ProductKeyVersion _microProductKeyVersion = ProductKeyVersion.BLANK; | ||
private ProductKeyVersion _minorProductKeyVersion = ProductKeyVersion.BLANK; | ||
private String _product; | ||
private int _productRank = -1; | ||
private boolean _quarterly = false; | ||
|
||
} |
Oops, something went wrong.