admin
2021-04-27 f3ff5ab043cf612e119fd90cd82e49b2cfc2ab5a
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
package com.yeshi.buwan.util;
 
import java.util.ArrayList;
import java.util.List;
 
import com.yeshi.buwan.domain.VideoType;
 
public class VideoTypeUtil {
    public static String getVideoTypeName(VideoType type) {
        String result = "";
        List<String> nameList = new ArrayList<String>();
        nameList.add(type.getName());
        while (type.getParent() != null) {
            type = type.getParent();
            nameList.add(type.getName());
        }
        for (int i = nameList.size() - 1; i >= 0; i--) {
            result += nameList.get(i) + "-";
        }
        if (result.endsWith("-"))
            result = result.substring(0, result.length() - 1);
        return result;
    }
 
 
}