blob: 76d848e3d1ccf466b8d6e15e8513599bfacc220f (
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
|
package com.yahoo.vespa.hosted.controller.api.integration.deployment;
import com.yahoo.config.provision.ApplicationId;
import java.util.Objects;
/**
* Immutable ID of a job that may be run.
*
* @author jonmv
*/
public class JobId {
private final ApplicationId application;
private final JobType type;
public JobId(ApplicationId application, JobType type) {
this.application = Objects.requireNonNull(application, "ApplicationId cannot be null!");
this.type = Objects.requireNonNull(type, "JobType cannot be null!");
}
public ApplicationId application() { return application; }
public JobType type() { return type; }
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
JobId jobId = (JobId) o;
return application.equals(jobId.application) &&
type == jobId.type;
}
@Override
public int hashCode() {
return Objects.hash(application, type);
}
@Override
public String toString() {
return type.jobName() + " for " + application;
}
}
|