
com.openshift.internal.client.StandaloneCartridge Maven / Gradle / Ivy
The newest version!
/*******************************************************************************
* Copyright (c) 2011 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is 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, Inc. - initial API and implementation
******************************************************************************/
package com.openshift.internal.client;
import com.openshift.client.cartridge.IStandaloneCartridge;
/**
* A cartridge that is available on the openshift server. This class is no enum
* since we dont know all available types and they may change at any time.
*
* @author André Dietisheim
*/
public class StandaloneCartridge implements IStandaloneCartridge {
private final String name;
private String displayName;
private String description;
public StandaloneCartridge(String name) {
this(name, null, null);
}
public StandaloneCartridge(String name, String version) {
this(name + NAME_VERSION_DELIMITER + version, null, null);
}
public StandaloneCartridge(String name, String displayName, String description) {
this.name = name;
this.displayName = displayName;
this.description = description;
}
public String getName() {
return name;
}
public String getDisplayName() {
return displayName;
}
public String getDescription() {
return description;
}
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((name == null) ? 0 : name.hashCode());
return result;
}
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
StandaloneCartridge other = (StandaloneCartridge) obj;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
return true;
}
public String toString() {
return "StandaloneCartridge [name=" + name + "]";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy