Project

General

Profile

Download (1.27 KB) Statistics
| Branch: | Tag: | Revision:
1
// $Id$
2
/**
3
* Copyright (C) 2016 EDIT
4
* European Distributed Institute of Taxonomy
5
* http://www.e-taxonomy.eu
6
*
7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8
* See LICENSE.TXT at the top of this package for the full license terms.
9
*/
10
package eu.etaxonomy.cdm.model.metadata;
11

    
12
import eu.etaxonomy.cdm.model.taxon.Classification;
13
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
14

    
15
/**
16
 * @author a.mueller
17
 * @date 03.06.2016
18
 *
19
 */
20
public class PreferenceSubject {
21

    
22
    public static final String ROOT = "/";
23

    
24
    private String subject;
25

    
26
    public static PreferenceSubject NewDatabaseInstance(){
27
        return new PreferenceSubject(ROOT);
28
    }
29

    
30
    public static PreferenceSubject NewInstance(Classification classification){
31
        return NewInstance(classification.getRootNode());
32
    }
33

    
34
    public static PreferenceSubject NewInstance(TaxonNode taxonNode){
35
        String result = ROOT + "TaxonNode[" + taxonNode.treeIndex() + "]";
36
        return new PreferenceSubject(result);
37
    }
38

    
39

    
40
// *****************************************************/
41

    
42
    private PreferenceSubject(String subject){
43
        this.subject = subject;
44
    }
45

    
46

    
47
    @Override
48
    public String toString() {
49
        return subject;
50
    }
51
}
(4-4/6)