Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: df27ddef2de693890c9b4d05127b8a6bdd44adfe (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
63
/*******************************************************************************
 * Copyright (c) 2014 Red Hat.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Red Hat - Initial Contribution
 *******************************************************************************/
package org.eclipse.linuxtools.internal.docker.core;

import org.eclipse.linuxtools.docker.core.IDockerConfParameter;

import com.spotify.docker.client.messages.HostConfig.LxcConfParameter;

public class DockerConfParameter implements IDockerConfParameter {

	private final String key;
	private final String value;

	public DockerConfParameter(final LxcConfParameter confParameter) {
		this.key = confParameter.key();
		this.value = confParameter.value();
	}

	@Override
	public String key() {
		return key;
	}

	@Override
	public String value() {
		return value;
	}

	@Override
	public boolean equals(Object obj) {

		if (this == obj)
			return true;

		if (obj == null || this.getClass() != obj.getClass())
			return false;

		IDockerConfParameter that = (IDockerConfParameter) obj;

		if (this.key != null) {
			if (!this.key.equals(that.key()))
				return false;
		} else if (that.key() != null)
			return false;

		if (this.value != null) {
			if (!this.value.equals(that.value()))
				return false;
		} else if (that.value() != null)
			return false;

		return true;
	}

}

Back to the top