All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.codingdebugallday.loader.ResourceWrapper Maven / Gradle / Ivy

The newest version!
package com.github.codingdebugallday.loader;

import java.util.*;

import org.springframework.core.io.Resource;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;

/**
 * 

* 资源包装类 *

* * @author isaac 2020/6/16 11:03 * @since 1.0 */ public class ResourceWrapper { private final List resources = new ArrayList<>(); private final Set classPackageNames = new HashSet<>(); private final Map extensions = new HashMap<>(); public void addResource(Resource resource) { if (Objects.nonNull(resource)) { resources.add(resource); } } public void addResources(List resources) { if (!CollectionUtils.isEmpty(resources)) { this.resources.addAll(resources); } } public List getResources() { return Collections.unmodifiableList(resources); } public void addClassPackageName(String classFullName) { if (!StringUtils.isEmpty(classFullName)) { classPackageNames.add(classFullName); } } public void addClassPackageNames(Set classPackageNames) { if (!CollectionUtils.isEmpty(classPackageNames)) { this.classPackageNames.addAll(classPackageNames); } } public Set getClassPackageNames() { return Collections.unmodifiableSet(classPackageNames); } public void addExtension(String key, Object value) { extensions.put(key, value); } public Object getExtension(String key) { return extensions.get(key); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy