-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat:1.升级springboot -> 3.2.0 mybatis -> 3.0.3... 全面支持jdk21。2.优化uno-te…
…st模块
- Loading branch information
Showing
36 changed files
with
241 additions
and
618 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
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
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
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
24 changes: 24 additions & 0 deletions
24
uno-core/src/main/java/cc/allio/uno/core/datastructure/tree/ComparableElement.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,24 @@ | ||
package cc.allio.uno.core.datastructure.tree; | ||
|
||
import lombok.NonNull; | ||
|
||
import java.io.Serializable; | ||
import java.util.Comparator; | ||
|
||
public class ComparableElement<T extends ComparableElement<T>> extends DefaultElement { | ||
|
||
private final Comparator<T> comparator; | ||
|
||
public ComparableElement(@NonNull Serializable id, Comparator<T> comparator) { | ||
super(id); | ||
this.comparator = comparator; | ||
} | ||
|
||
@Override | ||
public void addChildren(Element element) { | ||
super.addChildren(element); | ||
if (comparator != null) { | ||
getChildren().sort((o1, o2) -> comparator.compare((T) o1, (T) o2)); | ||
} | ||
} | ||
} |
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
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
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
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
Oops, something went wrong.