comparison src/main/java/edu/harvard/iq/dataverse/DatasetAuthor.java @ 10:a50cf11e5178

Rewrite LGDataverse completely upgrading to dataverse4.0
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Tue, 08 Sep 2015 17:00:21 +0200
parents
children
comparison
equal deleted inserted replaced
9:5926d6419569 10:a50cf11e5178
1 /*
2 * To change this license header, choose License Headers in Project Properties.
3 * To change this template file, choose Tools | Templates
4 * and open the template in the editor.
5 */
6
7 package edu.harvard.iq.dataverse;
8
9 import java.util.Comparator;
10
11
12 /**
13 *
14 * @author skraffmiller
15 */
16
17 public class DatasetAuthor {
18
19 public static Comparator<DatasetAuthor> DisplayOrder = new Comparator<DatasetAuthor>(){
20 @Override
21 public int compare(DatasetAuthor o1, DatasetAuthor o2) {
22 return o1.getDisplayOrder()-o2.getDisplayOrder();
23 }
24 };
25
26 private DatasetVersion datasetVersion;
27 public DatasetVersion getDatasetVersion() {
28 return datasetVersion;
29 }
30 public void setDatasetVersion(DatasetVersion metadata) {
31 this.datasetVersion = metadata;
32 }
33
34 //@NotBlank(message = "Please enter an Author Name for your dataset.")
35 private DatasetField name;
36
37 public DatasetField getName() {
38 return this.name;
39 }
40 public void setName(DatasetField name) {
41 this.name = name;
42 }
43
44 private int displayOrder;
45 public int getDisplayOrder() {
46 return this.displayOrder;
47 }
48 public void setDisplayOrder(int displayOrder) {
49 this.displayOrder = displayOrder;
50 }
51
52 private DatasetField affiliation;
53 public DatasetField getAffiliation() {
54 return this.affiliation;
55 }
56 public void setAffiliation(DatasetField affiliation) {
57 this.affiliation = affiliation;
58 }
59
60 private String idType;
61
62 public String getIdType() {
63 return idType;
64 }
65
66 public void setIdType(String idType) {
67 this.idType = idType;
68 }
69
70 private String idValue;
71
72
73 public String getIdValue() {
74 return idValue;
75 }
76
77 public void setIdValue(String idValue) {
78 this.idValue = idValue;
79 if (!this.idValue.isEmpty()){
80 setIdType("ORCID");
81 } else {
82 setIdType("");
83 }
84 }
85
86 public boolean isEmpty() {
87 return ( (affiliation==null || affiliation.getValue().trim().equals(""))
88 && (name==null || name.getValue().trim().equals(""))
89 );
90 }
91
92 }