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

com.github.dadiyang.httpinvoker.propertyresolver.PropertiesBasePropertyResolver Maven / Gradle / Ivy

There is a newer version: 1.2.4
Show newest version
package com.github.dadiyang.httpinvoker.propertyresolver;

import java.util.Properties;

/**
 * A PropertyResolver base on a Properties object.
 *
 * @author dadiyang
 * @since 1.0.9
 */
public class PropertiesBasePropertyResolver implements PropertyResolver {
    private Properties properties;

    public PropertiesBasePropertyResolver(Properties properties) {
        this.properties = properties;
    }

    @Override
    public boolean containsProperty(String key) {
        return properties.containsKey(key);
    }

    @Override
    public String getProperty(String key) {
        return properties.getProperty(key);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        PropertiesBasePropertyResolver that = (PropertiesBasePropertyResolver) o;
        return properties != null ? properties.equals(that.properties) : that.properties == null;
    }

    @Override
    public int hashCode() {
        return properties != null ? properties.hashCode() : 0;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy