001package org.nuxeo.box.api.utils; 002 003import org.nuxeo.box.api.marshalling.dao.BoxResourceType; 004 005/** 006 * Utils class. 007 */ 008public final class Utils { 009 010 /** 011 * Private constructor so the class cannot be instantiated. 012 */ 013 private Utils() { 014 } 015 016 /** 017 * Given a resource type, get the string for it's REST API container. For example, given a 018 * {@link org.nuxeo.box.api.marshalling.dao.BoxResourceType#FILE}, it it's container would be "files". 019 * 020 * @param type type 021 * @return container string 022 */ 023 public static String getContainerString(final BoxResourceType type) { 024 switch (type) { 025 case FILE_VERSION: 026 return "versions"; 027 default: 028 return type.toPluralString(); 029 } 030 } 031 032}