All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openlca.io.CategoryPath Maven / Gradle / Ivy

There is a newer version: 2.2.1
Show newest version
package org.openlca.io;

import org.openlca.core.model.Category;
import org.openlca.util.Strings;

public class CategoryPath {

	private CategoryPath() {
	}

	public static String getFull(Category category) {
		return category != null
				? category.toPath()
				: "";
	}

	/**
	 * Max. 2 category names and 75 characters
	 */
	public static String getShort(Category category) {
		if (category == null)
			return "";
		if (category.category == null)
			return category.name;
		String shortPath = category.category.name + "/"
				+ category.name;
		return Strings.cut(shortPath, 75);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy