You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2021/10/10 04:29:16 UTC
[GitHub] [incubator-inlong] ruanwenjun opened a new issue #1602: [Feature] Optimize EntityStatus enum
ruanwenjun opened a new issue #1602:
URL: https://github.com/apache/incubator-inlong/issues/1602
### Description
1. Since we use contains to judge the status, it's better to use Set rather than List, and this also make the code consistent with other enums, in other enums, they all use set.
```java
// Determine whether the current state can be deleted
if (!EntityStatus.ALLOW_DELETE_BIZ_STATUS.contains(entity.getStatus())) {
LOGGER.error("current status was not allowed to delete");
throw new BusinessException(BizErrorCodeEnum.BUSINESS_DELETE_NOT_ALLOWED);
}
```
https://github.com/apache/incubator-inlong/blob/73d149610e1d88913a65529a5bb003bf1ea058a7/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/enums/EntityStatus.java#L72-L114
2. We can create an util to transform collection to ImmutableMap, currently, there are some duplicate code.
### Use case
_No response_
### Are you willing to submit PR?
- [X] Yes, I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-inlong] dockerzhang closed issue #1602: [Feature] Optimize EntityStatus enum
Posted by GitBox <gi...@apache.org>.
dockerzhang closed issue #1602:
URL: https://github.com/apache/incubator-inlong/issues/1602
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org