Browse Source
Merge pull request #13528 from thingsboard/fix/edqs
Fix EdqsState.isApiReady
pull/13537/head
Viacheslav Klimov
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
4 additions and
3 deletions
-
common/data/src/main/java/org/thingsboard/server/common/data/edqs/EdqsState.java
|
|
|
@ -20,7 +20,8 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
|
|
|
import lombok.Getter; |
|
|
|
import lombok.NoArgsConstructor; |
|
|
|
import lombok.Setter; |
|
|
|
import org.apache.commons.lang3.BooleanUtils; |
|
|
|
|
|
|
|
import static org.apache.commons.lang3.BooleanUtils.toBooleanDefaultIfNull; |
|
|
|
|
|
|
|
@Getter |
|
|
|
@NoArgsConstructor |
|
|
|
@ -34,14 +35,14 @@ public class EdqsState { |
|
|
|
private EdqsApiMode apiMode; |
|
|
|
|
|
|
|
public boolean updateEdqsReady(boolean ready) { |
|
|
|
boolean changed = BooleanUtils.toBooleanDefaultIfNull(this.edqsReady, false) != ready; |
|
|
|
boolean changed = toBooleanDefaultIfNull(this.edqsReady, false) != ready; |
|
|
|
this.edqsReady = ready; |
|
|
|
return changed; |
|
|
|
} |
|
|
|
|
|
|
|
@JsonIgnore |
|
|
|
public boolean isApiReady() { |
|
|
|
return edqsReady && syncStatus == EdqsSyncStatus.FINISHED; |
|
|
|
return toBooleanDefaultIfNull(edqsReady, false) && syncStatus == EdqsSyncStatus.FINISHED; |
|
|
|
} |
|
|
|
|
|
|
|
@JsonIgnore |
|
|
|
|