Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/FullyNamedIdentity.java')
-rw-r--r--plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/FullyNamedIdentity.java45
1 files changed, 45 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/FullyNamedIdentity.java b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/FullyNamedIdentity.java
new file mode 100644
index 00000000000..b547065819c
--- /dev/null
+++ b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/type/FullyNamedIdentity.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Boeing.
+ * 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:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.osee.framework.jdk.core.type;
+
+import org.eclipse.osee.framework.jdk.core.util.Strings;
+
+/**
+ * @author Ryan D. Brooks
+ */
+public class FullyNamedIdentity<T> extends NamedIdentity<T> implements FullyNamed, HasDescription {
+ private final String description;
+
+ public FullyNamedIdentity(T guid, String name) {
+ this(guid, name, "");
+ }
+
+ public FullyNamedIdentity(T guid, String name, String description) {
+ super(guid, name);
+ this.description = description;
+ }
+
+ @Override
+ public String getUnqualifiedName() {
+ String name = getName();
+ if (Strings.isValid(name)) {
+ int index = name.lastIndexOf('.');
+ name = name.substring(index + 1);
+ }
+ return name;
+ }
+
+ @Override
+ public String getDescription() {
+ return description;
+ }
+} \ No newline at end of file

Back to the top