Created by 5zig. All rights reserved © 2015 Class for Pattern Matching Result, used in ServerListener to avoid IndexArrayOutOfBoundsException.
| 9 | * Class for Pattern Matching Result, used in ServerListener to avoid IndexArrayOutOfBoundsException. |
| 10 | */ |
| 11 | public class PatternResult implements IPatternResult { |
| 12 | |
| 13 | private final List<String> result; |
| 14 | private boolean ignoreMessage = false; |
| 15 | |
| 16 | public PatternResult(List<String> result) { |
| 17 | this.result = result; |
| 18 | } |
| 19 | |
| 20 | public int size() { |
| 21 | return result.size(); |
| 22 | } |
| 23 | |
| 24 | public String get(int index) { |
| 25 | if (index < 0 || index >= size()) |
| 26 | return ""; |
| 27 | return result.get(index); |
| 28 | } |
| 29 | |
| 30 | @Override |
| 31 | public void ignoreMessage(boolean ignore) { |
| 32 | this.ignoreMessage = ignore; |
| 33 | } |
| 34 | |
| 35 | boolean shouldMessageBeIgnored() { |
| 36 | return ignoreMessage; |
| 37 | } |
| 38 | |
| 39 | @Override |
| 40 | public String toString() { |
| 41 | return result.toString(); |
| 42 | } |
| 43 | } |
nothing calls this directly
no outgoing calls
no test coverage detected