public class RankableObjectWithFields extends Object implements Rankable, Serializable
This class wraps an objects and its associated count, including any additional data fields.
This class can be used, for instance, to track the number of occurrences of an object in a Storm topology.Constructor and Description |
---|
RankableObjectWithFields(Object obj,
long count,
Object... otherFields) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Rankable other) |
Rankable |
copy()
Note: We do not defensively copy the wrapped object and any accompanying fields.
|
boolean |
equals(Object o) |
static RankableObjectWithFields |
from(Tuple tuple)
Construct a new instance based on the provided
Tuple . |
long |
getCount() |
List<Object> |
getFields() |
Object |
getObject() |
int |
hashCode() |
String |
toString() |
public static RankableObjectWithFields from(Tuple tuple)
Construct a new instance based on the provided Tuple
.
getFields()
.tuple
- public List<Object> getFields()
public int compareTo(Rankable other)
compareTo
in interface Comparable<Rankable>
Copyright © 2022 The Apache Software Foundation. All Rights Reserved.