summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/openslx/virtualization/configuration/container/ContainerBindMount.java
blob: ca8f35f2fa945b15e023e4a25208f63df9b626a6 (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package org.openslx.virtualization.configuration.container;

import java.util.Objects;

/**
 * This class implements a model for a bind mount entry in the docker context
 * (eg. docker run  ... --mount type=bind,source=source,target=target,options ... ). A list of objects of this class is stored in
 * {@link ContainerMeta}.
 */
public class ContainerBindMount {

	private String source;
	private String target;
	private String options;

	public ContainerBindMount() {
	}

	public ContainerBindMount(String source, String target, String options) {
		this.source = source;
		this.target = target;
		this.options = options;
	}

	public String getSource() {
		return source;
	}

	public void setSource(String source) {
		this.source = source;
	}

	public String getTarget() {
		return target;
	}

	public void setTarget(String target) {
		this.target = target;
	}

	public String getOptions() {
		return options;
	}

	public void setOptions(String options) {
		this.options = options;
	}

	@Override public boolean equals(Object o) {
		if (this == o)
			return true;
		if (o == null || getClass() != o.getClass())
			return false;
		ContainerBindMount that = (ContainerBindMount) o;
		return Objects.equals(source, that.source) && Objects.equals(target, that.target) && Objects.equals(
				options, that.options);
	}

	@Override public int hashCode() {
		return Objects.hash(source, target, options);
	}
}