Child: [r6] (diff)

Download this file

Person.java    63 lines (50 with data), 1.6 kB

 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
* SPDXVersion: SPDX-1.1
* Person: Person: Nuno Brito (nuno.brito@triplecheck.de)
* Person: Organization: TripleCheck (contact@triplecheck.de)
* Created: 2013-08-29T00:00:00Z
* LicenseName: NOASSERTION
* FileName: Person.java
* FileType: SOURCE
* FileCopyrightText: <text> Copyright 2013 Nuno Brito, TripleCheck </text>
* FileComment: <text> Class defining the identity of a given person </text>
*/
package spdxlib;
public class Person {
private String
person, // mandatory field
personEmail, // optional field
organization, // mandatory field
organizationEmail, // optional field
tool, // mandatory field
toolVersion // mandatory field
;
public TagValue
tagPerson,
tagOrganization,
tagTool;
/**
* Provides a distinctive identifier title
* @return
*/
public String getTitle(){
// if there is a name, use it
if(tagPerson != null){
return tagPerson.toString();
}
// or use the organization name if available
if(tagOrganization != null){
return tagOrganization.toString();
}
// or even use the tool name if available
if(tagTool != null){
return tagTool.toString();
}
// nothing good here, just return null..
return null;
}
@Override
public String toString(){
return getTitle();
}
}