Remove PROTOTYPE from some enums in query builders
This commit is contained in:
parent
cbbf80ca35
commit
90f300bb71
|
@ -39,15 +39,9 @@ public enum GeoValidationMethod implements Writeable<GeoValidationMethod>{
|
||||||
|
|
||||||
public static final GeoValidationMethod DEFAULT = STRICT;
|
public static final GeoValidationMethod DEFAULT = STRICT;
|
||||||
public static final boolean DEFAULT_LENIENT_PARSING = (DEFAULT != STRICT);
|
public static final boolean DEFAULT_LENIENT_PARSING = (DEFAULT != STRICT);
|
||||||
private static final GeoValidationMethod PROTOTYPE = DEFAULT;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public GeoValidationMethod readFrom(StreamInput in) throws IOException {
|
|
||||||
return GeoValidationMethod.values()[in.readVInt()];
|
|
||||||
}
|
|
||||||
|
|
||||||
public static GeoValidationMethod readGeoValidationMethodFrom(StreamInput in) throws IOException {
|
public static GeoValidationMethod readGeoValidationMethodFrom(StreamInput in) throws IOException {
|
||||||
return PROTOTYPE.readFrom(in);
|
return GeoValidationMethod.values()[in.readVInt()];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -31,8 +31,6 @@ import java.util.Locale;
|
||||||
public enum Operator implements Writeable<Operator> {
|
public enum Operator implements Writeable<Operator> {
|
||||||
OR, AND;
|
OR, AND;
|
||||||
|
|
||||||
private static final Operator PROTOTYPE = OR;
|
|
||||||
|
|
||||||
public BooleanClause.Occur toBooleanClauseOccur() {
|
public BooleanClause.Occur toBooleanClauseOccur() {
|
||||||
switch (this) {
|
switch (this) {
|
||||||
case OR:
|
case OR:
|
||||||
|
@ -55,8 +53,7 @@ public enum Operator implements Writeable<Operator> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public static Operator readOperatorFrom(StreamInput in) throws IOException {
|
||||||
public Operator readFrom(StreamInput in) throws IOException {
|
|
||||||
int ordinal = in.readVInt();
|
int ordinal = in.readVInt();
|
||||||
if (ordinal < 0 || ordinal >= values().length) {
|
if (ordinal < 0 || ordinal >= values().length) {
|
||||||
throw new IOException("Unknown Operator ordinal [" + ordinal + "]");
|
throw new IOException("Unknown Operator ordinal [" + ordinal + "]");
|
||||||
|
@ -64,10 +61,6 @@ public enum Operator implements Writeable<Operator> {
|
||||||
return values()[ordinal];
|
return values()[ordinal];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Operator readOperatorFrom(StreamInput in) throws IOException {
|
|
||||||
return PROTOTYPE.readFrom(in);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeTo(StreamOutput out) throws IOException {
|
public void writeTo(StreamOutput out) throws IOException {
|
||||||
out.writeVInt(this.ordinal());
|
out.writeVInt(this.ordinal());
|
||||||
|
|
Loading…
Reference in New Issue