fixup! Fix issues of template
* For Java code, provide a `equals` method as the behavior of Java == is different from C++ * For Python code, fix a has_feature bug
This commit is contained in:
parent
1465b60c02
commit
d835c0244e
|
@ -35,6 +35,14 @@ class ProtocolVersion implements Comparable<ProtocolVersion> {
|
|||
return protocolVersion;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object ob) {
|
||||
if (!(ob instanceof ProtocolVersion)) {
|
||||
return false;
|
||||
}
|
||||
return this.protocolVersion == ((ProtocolVersion) ob).protocolVersion;
|
||||
}
|
||||
|
||||
public boolean isSupported() {
|
||||
return supportedVersions.contains(this);
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ class ProtocolVersion:
|
|||
|
||||
@property
|
||||
def has_{{ feature | feature_name_transformer }}(self) -> bool:
|
||||
return self > ProtocolVersion({{ version | encode_version }})
|
||||
return self >= ProtocolVersion({{ version | encode_version }})
|
||||
|
||||
@staticmethod
|
||||
def with_{{ feature | feature_name_transformer }}() -> "ProtocolVersion":
|
||||
|
|
Loading…
Reference in New Issue