mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
34 lines
708 B
Java
34 lines
708 B
Java
package io.ebean;
|
|
|
|
import java.io.Serializable;
|
|
/**
|
|
* Holds a distinct value with it's count.
|
|
* (Used with {@link Query#findSingleAttributeList()} and {@link Query#setCountDistinct(CountDistinctOrder)}.)
|
|
* @author Roland Praml, FOCONIS AG
|
|
*/
|
|
public class CountedValue<A> implements Serializable {
|
|
private static final long serialVersionUID = -2267971668356749695L;
|
|
|
|
private final A value;
|
|
private final long count;
|
|
|
|
public CountedValue(A value, long count) {
|
|
this.value = value;
|
|
this.count = count;
|
|
}
|
|
|
|
public long getCount() {
|
|
return count;
|
|
}
|
|
|
|
public A getValue() {
|
|
return value;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return count + ": " + value;
|
|
}
|
|
|
|
}
|