2012-06-17 20:34:50 +02:00
|
|
|
/*******************************************************************************
|
2021-01-09 14:26:49 +01:00
|
|
|
* Copyright (c) 2015-2021 MINRES Technologies GmbH and others.
|
2012-06-17 20:34:50 +02:00
|
|
|
* 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:
|
2015-01-21 21:58:35 +01:00
|
|
|
* MINRES Technologies GmbH - initial API and implementation
|
2012-06-17 20:34:50 +02:00
|
|
|
*******************************************************************************/
|
2015-01-03 16:34:32 +01:00
|
|
|
package com.minres.scviewer.database;
|
2012-06-17 19:53:05 +02:00
|
|
|
|
2021-01-02 16:15:27 +01:00
|
|
|
import java.io.Serializable;
|
2015-11-15 22:15:37 +01:00
|
|
|
|
2021-01-09 12:43:02 +01:00
|
|
|
/**
|
|
|
|
* The Class RelationType.
|
|
|
|
*/
|
2021-01-02 16:15:27 +01:00
|
|
|
public class RelationType implements Serializable {
|
2021-01-09 12:43:02 +01:00
|
|
|
|
|
|
|
/** The Constant serialVersionUID. */
|
2021-01-02 16:15:27 +01:00
|
|
|
private static final long serialVersionUID = 6394859077558971735L;
|
|
|
|
|
2021-01-09 12:43:02 +01:00
|
|
|
/** The name. */
|
2015-01-01 23:17:32 +01:00
|
|
|
private String name;
|
|
|
|
|
2021-01-09 12:43:02 +01:00
|
|
|
/**
|
|
|
|
* Instantiates a new relation type.
|
|
|
|
*
|
|
|
|
* @param name the name
|
|
|
|
*/
|
2021-01-04 17:32:32 +01:00
|
|
|
RelationType(String name) {
|
2015-01-01 23:17:32 +01:00
|
|
|
super();
|
|
|
|
this.name = name;
|
|
|
|
}
|
|
|
|
|
2021-01-09 12:43:02 +01:00
|
|
|
/**
|
|
|
|
* Gets the name.
|
|
|
|
*
|
|
|
|
* @return the name
|
|
|
|
*/
|
2015-01-01 23:17:32 +01:00
|
|
|
public String getName() {
|
|
|
|
return name;
|
|
|
|
}
|
|
|
|
|
2021-01-09 12:43:02 +01:00
|
|
|
/**
|
|
|
|
* Sets the name.
|
|
|
|
*
|
|
|
|
* @param name the new name
|
|
|
|
*/
|
2015-01-01 23:17:32 +01:00
|
|
|
public void setName(String name) {
|
|
|
|
this.name = name;
|
|
|
|
}
|
2021-01-09 12:43:02 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* To string.
|
|
|
|
*
|
|
|
|
* @return the string
|
|
|
|
*/
|
|
|
|
public String toString() {
|
2015-10-27 23:39:33 +01:00
|
|
|
return name;
|
|
|
|
}
|
2021-01-09 12:43:02 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Hash code.
|
|
|
|
*
|
|
|
|
* @return the int
|
|
|
|
*/
|
2015-11-15 22:15:37 +01:00
|
|
|
@Override
|
|
|
|
public int hashCode() {
|
|
|
|
return name.hashCode();
|
|
|
|
}
|
2021-01-09 12:43:02 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Equals.
|
|
|
|
*
|
|
|
|
* @param obj the obj
|
|
|
|
* @return true, if successful
|
|
|
|
*/
|
2020-11-29 10:25:48 +01:00
|
|
|
@Override
|
|
|
|
public boolean equals(Object obj) {
|
2021-01-09 12:43:02 +01:00
|
|
|
if (obj instanceof RelationType)
|
|
|
|
return name.equals(((RelationType) obj).name);
|
2021-01-04 17:32:32 +01:00
|
|
|
else
|
|
|
|
return false;
|
2020-11-29 10:25:48 +01:00
|
|
|
}
|
2012-06-17 19:53:05 +02:00
|
|
|
}
|