forked from jpos/jPOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SimpleConfiguration is now Serializable
It also properly implements equals, hashCode and toString
- Loading branch information
Showing
2 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,14 +21,15 @@ | |
import java.io.BufferedInputStream; | ||
import java.io.FileInputStream; | ||
import java.io.IOException; | ||
import java.io.Serializable; | ||
import java.util.*; | ||
|
||
/** | ||
* @author [email protected] | ||
* @version $Id$ | ||
* @since jPOS 1.1 | ||
*/ | ||
public class SimpleConfiguration implements Configuration { | ||
public class SimpleConfiguration implements Configuration, Serializable { | ||
private Properties props; | ||
|
||
public SimpleConfiguration () { | ||
|
@@ -152,4 +153,26 @@ public synchronized void put (String name, Object value) { | |
public Set<String> keySet() { | ||
return props.stringPropertyNames(); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
SimpleConfiguration that = (SimpleConfiguration) o; | ||
return Objects.equals(props, that.props); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(props); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "SimpleConfiguration{" + | ||
"props=" + props + | ||
'}'; | ||
} | ||
|
||
private static final long serialVersionUID = -6361797037366246968L; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters