1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.giraph.scripting;
19
20 import com.google.common.base.MoreObjects;
21 import org.apache.giraph.graph.Language;
22 import org.codehaus.jackson.annotate.JsonCreator;
23 import org.codehaus.jackson.annotate.JsonProperty;
24
25 import com.google.common.base.Objects;
26
27
28
29
30 public class DeployedScript {
31
32 @JsonProperty
33 private final DeployType deployType;
34
35 @JsonProperty
36 private final String path;
37
38 @JsonProperty
39 private final Language language;
40
41
42
43
44
45
46
47
48 @JsonCreator
49 public DeployedScript(
50 @JsonProperty("path") String path,
51 @JsonProperty("deployType") DeployType deployType,
52 @JsonProperty("language") Language language) {
53 this.path = path;
54 this.deployType = deployType;
55 this.language = language;
56 }
57
58 public DeployType getDeployType() {
59 return deployType;
60 }
61
62 public String getPath() {
63 return path;
64 }
65
66 public Language getLanguage() {
67 return language;
68 }
69
70 @Override
71 public int hashCode() {
72 return Objects.hashCode(path, deployType, language);
73 }
74
75 @Override
76 public boolean equals(Object obj) {
77 if (this == obj) {
78 return true;
79 }
80 if (obj instanceof DeployedScript) {
81 DeployedScript other = (DeployedScript) obj;
82 return Objects.equal(path, other.path) &&
83 Objects.equal(deployType, other.deployType) &&
84 Objects.equal(language, other.language);
85 }
86 return false;
87 }
88
89 @Override
90 public String toString() {
91 return MoreObjects.toStringHelper(this)
92 .add("path", path)
93 .add("deployType", deployType)
94 .add("language", language)
95 .toString();
96 }
97 }