blob: 17945b8b5bdc60bba34b271761e5075a5340e461 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.grouping.result;
import static com.yahoo.text.Lowercase.toLowerCase;
/**
* This abstract class is used in {@link Group} instances where the identifying expression evaluated to a singe value.
*
* @author <a href="mailto:simon@yahoo-inc.com">Simon Thoresen</a>
*/
public abstract class ValueGroupId<T> extends GroupId {
private final T value;
/**
* Constructs a new instance of this class.
*
* @param type The type of this id's value.
* @param value The identifying value.
*/
public ValueGroupId(String type, T value) {
this(type, value, String.valueOf(value.toString()));
}
/**
* Constructs a new instance of this class.
*
* @param type The type of this id's value.
* @param value The identifying value.
* @param valueImage The String representation of the <tt>value</tt> argument.
*/
public ValueGroupId(String type, T value, String valueImage) {
super(type, valueImage);
this.value = value;
}
/**
* Returns the identifying value.
*
* @return The value.
*/
public T getValue() {
return value;
}
}
|