public class DefaultResourceStore extends Object implements ResourceStore
| 构造器和说明 |
|---|
DefaultResourceStore() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addResource(String type,
Resource resource)
添加资源
|
void |
addTemplate(String type,
ResourceMap template)
添加模板
|
void |
clearAllResources() |
void |
clearAllTemplates() |
void |
clearResources(String type) |
void |
clearTemplates(String type) |
int |
getAllResourceCount() |
int |
getResourceCount(String type) |
Map<String,List<Resource>> |
listAllResources() |
Map<String,List<ResourceMap>> |
listAllTemplates() |
List<Resource> |
listResourcesByType(String type) |
List<ResourceMap> |
listTemplatesByType(String type) |
String |
mergeTypeAndTag(String type,
String tag) |
Resource |
randomGetResourceByTypeAndTag(String type,
String tag)
随机获取某个资源
|
ResourceMap |
randomGetTemplateByTypeAndTag(String type,
String tag)
随机获取某个模板通过type
|
public void addResource(String type, Resource resource)
ResourceStoreaddResource 在接口中 ResourceStoretype - 验证码类型resource - 资源public void addTemplate(String type, ResourceMap template)
ResourceStoreaddTemplate 在接口中 ResourceStoretype - 验证码类型template - 模板public Resource randomGetResourceByTypeAndTag(String type, String tag)
ResourceStorerandomGetResourceByTypeAndTag 在接口中 ResourceStoretype - typepublic ResourceMap randomGetTemplateByTypeAndTag(String type, String tag)
ResourceStorerandomGetTemplateByTypeAndTag 在接口中 ResourceStoretype - typepublic void clearResources(String type)
public void clearAllResources()
public int getAllResourceCount()
public int getResourceCount(String type)
public void clearAllTemplates()
public void clearTemplates(String type)
public List<ResourceMap> listTemplatesByType(String type)
public Map<String,List<ResourceMap>> listAllTemplates()
Copyright © 2023. All rights reserved.