52938
|
1 |
/*
|
|
2 |
* Copyright (c) 2002-2016, the original author or authors.
|
|
3 |
*
|
|
4 |
* This software is distributable under the BSD license. See the terms of the
|
|
5 |
* BSD license in the documentation provided with this software.
|
|
6 |
*
|
58903
|
7 |
* https://opensource.org/licenses/BSD-3-Clause
|
52938
|
8 |
*/
|
|
9 |
package jdk.internal.org.jline.reader;
|
|
10 |
|
|
11 |
public class Macro implements Binding {
|
|
12 |
|
|
13 |
private final String sequence;
|
|
14 |
|
|
15 |
public Macro(String sequence) {
|
|
16 |
this.sequence = sequence;
|
|
17 |
}
|
|
18 |
|
|
19 |
public String getSequence() {
|
|
20 |
return sequence;
|
|
21 |
}
|
|
22 |
|
|
23 |
@Override
|
|
24 |
public boolean equals(Object o) {
|
|
25 |
if (this == o) return true;
|
|
26 |
if (o == null || getClass() != o.getClass()) return false;
|
|
27 |
Macro macro = (Macro) o;
|
|
28 |
return sequence.equals(macro.sequence);
|
|
29 |
}
|
|
30 |
|
|
31 |
@Override
|
|
32 |
public int hashCode() {
|
|
33 |
return sequence.hashCode();
|
|
34 |
}
|
|
35 |
|
|
36 |
@Override
|
|
37 |
public String toString() {
|
|
38 |
return "Macro[" +
|
|
39 |
sequence + ']';
|
|
40 |
}
|
|
41 |
}
|