1 |
43444
|
sandro.lab
|
package eu.dnetlib.msro.workflows.nodes.dedup.utils;
|
2 |
|
|
|
3 |
|
|
import java.util.Queue;
|
4 |
|
|
|
5 |
|
|
import com.google.gson.Gson;
|
6 |
|
|
import com.google.gson.GsonBuilder;
|
7 |
|
|
import eu.dnetlib.pace.config.DedupConfig;
|
8 |
|
|
|
9 |
|
|
/**
|
10 |
|
|
* The Class DedupConfigurationOrchestration.
|
11 |
|
|
*/
|
12 |
|
|
public class DedupConfigurationOrchestration {
|
13 |
|
|
|
14 |
|
|
/**
|
15 |
|
|
* The entity.
|
16 |
|
|
*/
|
17 |
|
|
private Entity entity;
|
18 |
|
|
|
19 |
|
|
/**
|
20 |
|
|
* The action set id.
|
21 |
|
|
*/
|
22 |
|
|
private String actionSetId;
|
23 |
|
|
|
24 |
|
|
/**
|
25 |
|
|
* The configurations.
|
26 |
|
|
*/
|
27 |
|
|
private Queue<DedupConfig> configurations;
|
28 |
|
|
|
29 |
|
|
public DedupConfigurationOrchestration() {
|
30 |
|
|
}
|
31 |
|
|
|
32 |
|
|
/**
|
33 |
|
|
* Instantiates a new dedup configuration orchestration.
|
34 |
|
|
*
|
35 |
|
|
* @param entity the entity
|
36 |
|
|
* @param actionSetId the action set id
|
37 |
|
|
* @param configurations the configurations
|
38 |
|
|
*/
|
39 |
|
|
public DedupConfigurationOrchestration(final Entity entity, final String actionSetId, final Queue<DedupConfig> configurations) {
|
40 |
|
|
super();
|
41 |
|
|
this.setEntity(entity);
|
42 |
|
|
this.setActionSetId(actionSetId);
|
43 |
|
|
this.setConfigurations(configurations);
|
44 |
|
|
}
|
45 |
|
|
|
46 |
|
|
/**
|
47 |
|
|
* From json.
|
48 |
|
|
*
|
49 |
|
|
* @param json the json
|
50 |
|
|
* @return the dedup configuration orchestration
|
51 |
|
|
*/
|
52 |
|
|
public static DedupConfigurationOrchestration fromJSON(final String json) {
|
53 |
|
|
return new Gson().fromJson(json, DedupConfigurationOrchestration.class);
|
54 |
|
|
}
|
55 |
|
|
|
56 |
|
|
/**
|
57 |
|
|
* Gets the entity.
|
58 |
|
|
*
|
59 |
|
|
* @return the entity
|
60 |
|
|
*/
|
61 |
|
|
public Entity getEntity() {
|
62 |
|
|
return entity;
|
63 |
|
|
}
|
64 |
|
|
|
65 |
|
|
public void setEntity(final Entity entity) {
|
66 |
|
|
this.entity = entity;
|
67 |
|
|
}
|
68 |
|
|
|
69 |
|
|
/**
|
70 |
|
|
* Gets the action set id.
|
71 |
|
|
*
|
72 |
|
|
* @return the action set id
|
73 |
|
|
*/
|
74 |
|
|
public String getActionSetId() {
|
75 |
|
|
return actionSetId;
|
76 |
|
|
}
|
77 |
|
|
|
78 |
|
|
public void setActionSetId(final String actionSetId) {
|
79 |
|
|
this.actionSetId = actionSetId;
|
80 |
|
|
}
|
81 |
|
|
|
82 |
|
|
/**
|
83 |
|
|
* Gets the configurations.
|
84 |
|
|
*
|
85 |
|
|
* @return the configurations
|
86 |
|
|
*/
|
87 |
|
|
public Queue<DedupConfig> getConfigurations() {
|
88 |
|
|
return configurations;
|
89 |
|
|
}
|
90 |
|
|
|
91 |
|
|
public void setConfigurations(final Queue<DedupConfig> configurations) {
|
92 |
|
|
this.configurations = configurations;
|
93 |
|
|
}
|
94 |
|
|
|
95 |
|
|
/*
|
96 |
|
|
* (non-Javadoc)
|
97 |
|
|
*
|
98 |
|
|
* @see java.lang.Object#toString()
|
99 |
|
|
*/
|
100 |
|
|
@Override
|
101 |
|
|
public String toString() {
|
102 |
|
|
return new GsonBuilder().setPrettyPrinting().create().toJson(this);
|
103 |
|
|
}
|
104 |
|
|
|
105 |
|
|
}
|