|
@@ -31,8 +31,6 @@ import java.util.Locale;
|
|
|
public enum Operator implements Writeable<Operator> {
|
|
|
OR, AND;
|
|
|
|
|
|
- private static final Operator PROTOTYPE = OR;
|
|
|
-
|
|
|
public BooleanClause.Occur toBooleanClauseOccur() {
|
|
|
switch (this) {
|
|
|
case OR:
|
|
@@ -55,8 +53,7 @@ public enum Operator implements Writeable<Operator> {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public Operator readFrom(StreamInput in) throws IOException {
|
|
|
+ public static Operator readOperatorFrom(StreamInput in) throws IOException {
|
|
|
int ordinal = in.readVInt();
|
|
|
if (ordinal < 0 || ordinal >= values().length) {
|
|
|
throw new IOException("Unknown Operator ordinal [" + ordinal + "]");
|
|
@@ -64,10 +61,6 @@ public enum Operator implements Writeable<Operator> {
|
|
|
return values()[ordinal];
|
|
|
}
|
|
|
|
|
|
- public static Operator readOperatorFrom(StreamInput in) throws IOException {
|
|
|
- return PROTOTYPE.readFrom(in);
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
public void writeTo(StreamOutput out) throws IOException {
|
|
|
out.writeVInt(this.ordinal());
|