forked from docker-java/docker-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVolume.java
More file actions
43 lines (34 loc) · 887 Bytes
/
Copy pathVolume.java
File metadata and controls
43 lines (34 loc) · 887 Bytes
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
package com.github.dockerjava.api.model;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
/**
* Represents a bind mounted volume in a Docker container.
*
* @see Bind
*/
public class Volume {
private String path;
public Volume(String path) {
this.path = path;
}
public String getPath() {
return path;
}
@Override
public String toString() {
return getPath();
}
@Override
public boolean equals(Object obj) {
if (obj instanceof Volume) {
Volume other = (Volume) obj;
return new EqualsBuilder().append(path, other.getPath()).isEquals();
} else {
return super.equals(obj);
}
}
@Override
public int hashCode() {
return new HashCodeBuilder().append(path).toHashCode();
}
}