Project

General

Profile

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