We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
基于 #119 ,我们应当基于 Container 接口提供一个新的子接口 LimitedContainer,它用于表示一个仅包含了固定的、有限个数数据源对象的容器。
Container
LimitedContainer
针对该类型的容器,我们可以提供一个自动生成镜像的功能,即自动为其创建一个 key-value 翻转的版本,就像 Guava 中的 BiMap 那样。比如:
// 原始容器 Map<String, String> origin = new HashMap<>(); origin.put("one", "1"); origin.put("two", "2"); origin.put("three", "3"); LimitedContainer<String> contanier = Containers.forMap("test", origin); containerManager.registerContanier(contanier); // 当注册到容器之后,自动为其生成一个镜像容器(若有必要),该镜像容器的命名空间与原始的容器有所区别 imitedContainer<String> mirrorContainer = containerManager.getContainer("test_reverse"); mirrorContainer.getAll(); // [{"1"="one"}, {"2"="two"}, {"3"="three"}]
该功能需要考虑两方面的因素:
ContainerLifeProcessor
ContainerProvider
ContainerManager
The text was updated successfully, but these errors were encountered:
No branches or pull requests
基于 #119 ,我们应当基于
Container
接口提供一个新的子接口LimitedContainer
,它用于表示一个仅包含了固定的、有限个数数据源对象的容器。针对该类型的容器,我们可以提供一个自动生成镜像的功能,即自动为其创建一个 key-value 翻转的版本,就像 Guava 中的 BiMap 那样。比如:
该功能需要考虑两方面的因素:
ContainerLifeProcessor
完成,在容器创建后自动为其创建,或者提供一个独立的ContainerProvider
负责为所有的容器提供镜像版本;ContainerManager
注册容器的时候就加以区分,或者想办法给个注解作为元数据用于区分;The text was updated successfully, but these errors were encountered: