-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update @rbv * be: 通知邮件保持 html * feat: report nref * be: Bad JSONArray format * out API Filter <Body> * pageSize max=1000 * fix: DATE DATETIME 比较 * fix: SafeObservable * v3.5.3
- Loading branch information
1 parent
87737a9
commit 8649f81
Showing
28 changed files
with
189 additions
and
80 deletions.
There are no files selected for viewing
Submodule @rbv
updated
from fecdd9 to d3707a
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
45 changes: 45 additions & 0 deletions
45
src/main/java/com/rebuild/core/service/SafeObservable.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,45 @@ | ||
/*! | ||
Copyright (c) REBUILD <https://getrebuild.com/> and/or its owners. All rights reserved. | ||
rebuild is dual-licensed under commercial and open source licenses (GPLv3). | ||
See LICENSE and COMMERCIAL in the project root for license information. | ||
*/ | ||
|
||
package com.rebuild.core.service; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Comparator; | ||
import java.util.List; | ||
|
||
/** | ||
* Thread-Safe <tt>Observable</tt> | ||
* | ||
* @author devezhao | ||
* @since 2023/12/22 | ||
*/ | ||
public class SafeObservable { | ||
|
||
final private List<SafeObserver> obs; | ||
|
||
public SafeObservable() { | ||
obs = new ArrayList<>(); | ||
} | ||
|
||
public void addObserver(SafeObserver o) { | ||
if (o == null) throw new NullPointerException(); | ||
if (!obs.contains(o)) { | ||
obs.add(o); | ||
obs.sort(Comparator.comparingInt(SafeObserver::getOrder)); | ||
} | ||
} | ||
|
||
public void notifyObservers(Object arg) { | ||
for (SafeObserver o : obs) { | ||
o.update(this, arg); | ||
} | ||
} | ||
|
||
public int countObservers() { | ||
return obs.size(); | ||
} | ||
} |
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,21 @@ | ||
/*! | ||
Copyright (c) REBUILD <https://getrebuild.com/> and/or its owners. All rights reserved. | ||
rebuild is dual-licensed under commercial and open source licenses (GPLv3). | ||
See LICENSE and COMMERCIAL in the project root for license information. | ||
*/ | ||
|
||
package com.rebuild.core.service; | ||
|
||
/** | ||
* Thread-Safe <tt>Observer</tt> | ||
* | ||
* @author devezhao | ||
* @since 2023/12/22 | ||
*/ | ||
public interface SafeObserver { | ||
|
||
void update(SafeObservable o, Object arg); | ||
|
||
int getOrder(); | ||
} |
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
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.