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 nameList = new ArrayList(); 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; } }