source: xssim/trunk/src/test/rewolucja/resources/utils/validator/ResourcePropertiesValidator.java @ 104

Revision 104, 679 bytes checked in by wojtekp, 13 years ago (diff)
  • Property svn:mime-type set to text/plain
Line 
1package test.rewolucja.resources.utils.validator;
2
3import java.util.Properties;
4
5import test.rewolucja.resources.physical.base.ComputingResource;
6
7public class ResourcePropertiesValidator implements ResourceValidator{
8
9        private Properties properties;
10        public ResourcePropertiesValidator(Properties properties) {
11                super();
12                this.properties = properties;
13        }       
14
15        @Override
16        public boolean validate(ComputingResource resource) {
17                Properties resProperties = resource.getProperties();
18                for(Object key:  properties.keySet()){
19                        String property = (String) key;
20                        if(resProperties.getProperty(property) != properties.getProperty(property))
21                                return false;
22                }
23                return true;
24        }
25
26}
Note: See TracBrowser for help on using the repository browser.