mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-18 02:44:49 +00:00
Write record influencers as they are expected in java (elastic/elasticsearch#379)
Original commit: elastic/x-pack-elasticsearch@d016684866
This commit is contained in:
parent
2a46837296
commit
d8b6ecfb31
@ -21,8 +21,8 @@ import java.util.Objects;
|
|||||||
/**
|
/**
|
||||||
* Influence field name and list of influence field values/score pairs
|
* Influence field name and list of influence field values/score pairs
|
||||||
*/
|
*/
|
||||||
public class Influence extends ToXContentToBytes implements Writeable
|
public class Influence extends ToXContentToBytes implements Writeable {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* Note all publicly exposed field names are "influencer" not "influence"
|
* Note all publicly exposed field names are "influencer" not "influence"
|
||||||
*/
|
*/
|
||||||
@ -42,8 +42,7 @@ public class Influence extends ToXContentToBytes implements Writeable
|
|||||||
private String field;
|
private String field;
|
||||||
private List<String> fieldValues;
|
private List<String> fieldValues;
|
||||||
|
|
||||||
public Influence(String field, List<String> fieldValues)
|
public Influence(String field, List<String> fieldValues) {
|
||||||
{
|
|
||||||
this.field = field;
|
this.field = field;
|
||||||
this.fieldValues = fieldValues;
|
this.fieldValues = fieldValues;
|
||||||
}
|
}
|
||||||
@ -68,43 +67,34 @@ public class Influence extends ToXContentToBytes implements Writeable
|
|||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getInfluencerFieldName()
|
public String getInfluencerFieldName() {
|
||||||
{
|
|
||||||
return field;
|
return field;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getInfluencerFieldValues()
|
public List<String> getInfluencerFieldValues() {
|
||||||
{
|
|
||||||
return fieldValues;
|
return fieldValues;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode()
|
public int hashCode() {
|
||||||
{
|
|
||||||
return Objects.hash(field, fieldValues);
|
return Objects.hash(field, fieldValues);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj)
|
public boolean equals(Object obj) {
|
||||||
{
|
if (this == obj) {
|
||||||
if (this == obj)
|
|
||||||
{
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj == null)
|
if (obj == null) {
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getClass() != obj.getClass())
|
if (getClass() != obj.getClass()) {
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Influence other = (Influence) obj;
|
Influence other = (Influence) obj;
|
||||||
|
return Objects.equals(field, other.field) && Objects.equals(fieldValues, other.fieldValues);
|
||||||
return Objects.equals(field, other.field) &&
|
|
||||||
Objects.equals(fieldValues, other.fieldValues);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user