blob: 1eb27cd31c29d25e0446e72cce02b9ade94bbc51 (
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
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.searchdefinition.fieldoperation;
import com.yahoo.searchdefinition.document.SDField;
/**
* @author Einar M R Rosenvinge
*/
public class AliasOperation implements FieldOperation {
private String aliasedName;
private String alias;
public AliasOperation(String aliasedName, String alias) {
this.aliasedName = aliasedName;
this.alias = alias;
}
public String getAliasedName() {
return aliasedName;
}
public void setAliasedName(String aliasedName) {
this.aliasedName = aliasedName;
}
public String getAlias() {
return alias;
}
public void setAlias(String alias) {
this.alias = alias;
}
public void apply(SDField field) {
if (aliasedName == null) {
aliasedName = field.getName();
}
field.getAliasToName().put(alias, aliasedName);
}
}
|