001
014
015 package com.liferay.portal.kernel.cache.configuration;
016
017 import com.liferay.portal.kernel.cache.CallbackFactory;
018 import com.liferay.portal.kernel.util.HashUtil;
019
020 import java.util.Properties;
021
022
025 public class CallbackConfiguration {
026
027 public CallbackConfiguration(
028 CallbackFactory callbackFactory, Properties properties) {
029
030 if (callbackFactory == null) {
031 throw new NullPointerException("Callback factory is null");
032 }
033
034 if (properties == null) {
035 throw new NullPointerException("Properties is null");
036 }
037
038 _callbackFactory = callbackFactory;
039 _properties = (Properties)properties.clone();
040 }
041
042 @Override
043 public boolean equals(Object object) {
044 if (this == object) {
045 return true;
046 }
047
048 if (!(object instanceof CallbackConfiguration)) {
049 return false;
050 }
051
052 CallbackConfiguration callbackConfiguration =
053 (CallbackConfiguration)object;
054
055 if ((_callbackFactory == callbackConfiguration._callbackFactory) &&
056 _properties.equals(callbackConfiguration._properties)) {
057
058 return true;
059 }
060
061 return false;
062 }
063
064 public CallbackFactory getCallbackFactory() {
065 return _callbackFactory;
066 }
067
068 public Properties getProperties() {
069 return (Properties)_properties.clone();
070 }
071
072 @Override
073 public int hashCode() {
074 int hash = HashUtil.hash(0, _callbackFactory);
075
076 return HashUtil.hash(hash, _properties);
077 }
078
079 private final CallbackFactory _callbackFactory;
080 private final Properties _properties;
081
082 }