blob: e6b8912bc358994e05e83d0cef711eb2651efc4d (
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
|
/*******************************************************************************
* Copyright (c) 2014 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;
/**
* @author Donald G. Dunne
*/
public class UuidNamedIdentity<T> extends UuidBaseIdentity<T> implements UuidIdentifiable<T>, Comparable<Named> {
private String name;
public UuidNamedIdentity(T uid, String name) {
super(uid);
this.name = name;
}
@Override
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public int compareTo(Named other) {
if (other != null && other.getName() != null && getName() != null) {
return getName().compareTo(other.getName());
}
return -1;
}
@Override
public String toString() {
return getName();
}
}
|