2012-06-17 20:34:50 +02:00
|
|
|
/*******************************************************************************
|
|
|
|
* Copyright (c) 2012 IT Just working.
|
2021-01-09 12:43:02 +01:00
|
|
|
* Copyright (c) 2020 MINRES Technologies GmbH
|
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:
|
|
|
|
* IT Just working - initial API and implementation
|
|
|
|
*******************************************************************************/
|
2021-01-02 16:15:27 +01:00
|
|
|
package com.minres.scviewer.database.text;
|
|
|
|
|
|
|
|
import java.io.Serializable;
|
2012-06-17 19:53:05 +02:00
|
|
|
|
2015-01-03 16:34:32 +01:00
|
|
|
import com.minres.scviewer.database.AssociationType;
|
|
|
|
import com.minres.scviewer.database.DataType;
|
2021-01-02 16:15:27 +01:00
|
|
|
import com.minres.scviewer.database.tx.ITxAttribute;
|
2012-06-17 19:53:05 +02:00
|
|
|
|
2021-01-09 12:43:02 +01:00
|
|
|
/**
|
|
|
|
* The Class TxAttribute.
|
|
|
|
*/
|
|
|
|
public class TxAttribute implements ITxAttribute, Serializable {
|
|
|
|
|
|
|
|
/** The Constant serialVersionUID. */
|
2021-01-02 16:15:27 +01:00
|
|
|
private static final long serialVersionUID = 4767726016651807152L;
|
|
|
|
|
2021-01-09 12:43:02 +01:00
|
|
|
/** The attribute type. */
|
2021-01-08 20:31:24 +01:00
|
|
|
private final TxAttributeType attributeType;
|
2015-01-01 23:17:32 +01:00
|
|
|
|
2021-01-09 12:43:02 +01:00
|
|
|
/** The value. */
|
2021-01-08 20:31:24 +01:00
|
|
|
private final String value;
|
2021-01-09 12:43:02 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Instantiates a new tx attribute.
|
|
|
|
*
|
|
|
|
* @param type the type
|
|
|
|
* @param value the value
|
|
|
|
*/
|
|
|
|
TxAttribute(TxAttributeType type, String value) {
|
|
|
|
this.attributeType = type;
|
|
|
|
this.value = value;
|
2012-06-17 19:53:05 +02:00
|
|
|
}
|
|
|
|
|
2021-01-09 12:43:02 +01:00
|
|
|
/**
|
|
|
|
* Gets the name.
|
|
|
|
*
|
|
|
|
* @return the name
|
|
|
|
*/
|
2012-06-17 19:53:05 +02:00
|
|
|
@Override
|
|
|
|
public String getName() {
|
|
|
|
return attributeType.getName();
|
|
|
|
}
|
|
|
|
|
2021-01-09 12:43:02 +01:00
|
|
|
/**
|
|
|
|
* Gets the type.
|
|
|
|
*
|
|
|
|
* @return the type
|
|
|
|
*/
|
2012-06-17 19:53:05 +02:00
|
|
|
@Override
|
2015-01-03 16:34:32 +01:00
|
|
|
public AssociationType getType() {
|
2021-01-02 16:15:27 +01:00
|
|
|
return attributeType.getType();
|
2012-06-17 19:53:05 +02:00
|
|
|
}
|
|
|
|
|
2021-01-09 12:43:02 +01:00
|
|
|
/**
|
|
|
|
* Gets the data type.
|
|
|
|
*
|
|
|
|
* @return the data type
|
|
|
|
*/
|
2015-01-03 16:34:32 +01:00
|
|
|
@Override
|
|
|
|
public DataType getDataType() {
|
2021-01-02 16:15:27 +01:00
|
|
|
return attributeType.getDataType();
|
|
|
|
}
|
|
|
|
|
2021-01-09 12:43:02 +01:00
|
|
|
/**
|
|
|
|
* Gets the value.
|
|
|
|
*
|
|
|
|
* @return the value
|
|
|
|
*/
|
2021-01-02 16:15:27 +01:00
|
|
|
@Override
|
|
|
|
public Object getValue() {
|
|
|
|
return value;
|
2015-01-01 23:17:32 +01:00
|
|
|
}
|
|
|
|
|
2012-06-17 19:53:05 +02:00
|
|
|
}
|