Project

General

Profile

« Previous | Next » 

Revision 0c763d5f

Added by Andreas Müller almost 3 years ago

ref #9624, ref #7305, ref #9326 refactor team formatting all over cdmlib (including et al. handling for biblio references)

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/strategy/cache/agent/PersonDefaultCacheStrategy.java
32 32

  
33 33
	final static UUID uuid = UUID.fromString("9abda0e1-d5cc-480f-be38-40a510a3f253");
34 34

  
35
	private static PersonDefaultCacheStrategy instance;
36

  
35 37
	private String initialsSeparator = "";
36 38

  
37
	static public PersonDefaultCacheStrategy NewInstance(){
39
	public static PersonDefaultCacheStrategy NewInstance(){
38 40
		return new PersonDefaultCacheStrategy();
39 41
	}
40 42

  
43
	public static PersonDefaultCacheStrategy INSTANCE(){
44
	    if (instance == null){
45
	        instance = PersonDefaultCacheStrategy.NewInstance();
46
	    }
47
	    return instance;
48
	}
49

  
41 50
// ******************** CONSTRUCTOR **********************************/
51

  
42 52
	private PersonDefaultCacheStrategy() {
43 53
		super();
44 54
	}
45 55

  
46

  
47

  
48 56
	@Override
49 57
	protected UUID getUuid() {
50 58
		return uuid;
......
55 63
		return person.getNomenclaturalTitle();
56 64
	}
57 65

  
66
    @Override
67
    public String getFamilyTitle(Person person) {
68
        return isNotBlank(person.getFamilyName())? person.getFamilyName() : person.getTitleCache();
69
    }
70

  
58 71
    @Override
59 72
    public String getTitleCache(Person person) {
60 73
        String result = "";
......
75 88
        return person.toString();
76 89
    }
77 90

  
78
    /**
79
     * @param existing
80
     * @param person
81
     * @return
82
     */
83 91
    private String addInitials(String existing, Person person) {
84 92
        String result = existing;
85 93
        String initials = person.getInitials();

Also available in: Unified diff