diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2019-07-02 16:59:14 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2019-07-02 16:59:14 -0400 |
| commit | 5a1b096b47fbcca7e9cc6a24db558128f4cdd87f (patch) | |
| tree | 8e5046c58978e0fd62a2758889cf61defdd807b5 /src/main/java/bjc/everge/ReplOpts.java | |
| parent | 20000281fc88c188eb81d9d3d954119725a03ca6 (diff) | |
Convert to using ControlledString
All of the places that parse controls now use ControlledString instead
of doing their own stuff. -\(o-o)/-
Diffstat (limited to 'src/main/java/bjc/everge/ReplOpts.java')
| -rw-r--r-- | src/main/java/bjc/everge/ReplOpts.java | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/src/main/java/bjc/everge/ReplOpts.java b/src/main/java/bjc/everge/ReplOpts.java index 1ddfc79..85765d5 100644 --- a/src/main/java/bjc/everge/ReplOpts.java +++ b/src/main/java/bjc/everge/ReplOpts.java @@ -45,26 +45,32 @@ public class ReplOpts { public PrintStream outStream = System.out; public PrintStream errStream = System.err; - @Override - public boolean equals(Object o) { - if (o == null) return false; - - if (!getClass().equals(o.getClass())) return false; - - ReplOpts ro = (ReplOpts)o; - - if (isPerf != ro.isPerf) return false; - - if (isDebug != ro.isDebug) return false; - if (isTrace != ro.isTrace) return false; - - if (defPrior != ro.defPrior) return false; - if (defStage != ro.defStage) return false; - if (defMulti != ro.defMulti) return false; - - if (defStatus != ro.defStatus) return false; - + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + (defMulti ? 1231 : 1237); + result = prime * result + defPrior; + result = prime * result + defStage; + result = prime * result + ((defStatus == null) ? 0 : defStatus.hashCode()); + result = prime * result + (isDebug ? 1231 : 1237); + result = prime * result + (isPerf ? 1231 : 1237); + result = prime * result + (isTrace ? 1231 : 1237); + return result; + } + @Override + public boolean equals(Object obj) { + if (this == obj) return true; + if (obj == null) return false; + if (getClass() != obj.getClass()) return false; + ReplOpts other = (ReplOpts) obj; + if (defMulti != other.defMulti) return false; + if (defPrior != other.defPrior) return false; + if (defStage != other.defStage) return false; + if (defStatus != other.defStatus) return false; + if (isDebug != other.isDebug) return false; + if (isPerf != other.isPerf) return false; + if (isTrace != other.isTrace) return false; return true; } } |
