Package omero.gateway.util
Class Utils
- java.lang.Object
-
- omero.gateway.util.Utils
-
public class Utils extends java.lang.ObjectCollection of methods used to set the name of files to import and to handle enumerations.- Since:
- 5.1
-
-
Constructor Summary
Constructors Constructor Description Utils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <E extends omero.model.IObject>
java.util.List<java.lang.String>fromEnum(java.util.Collection<E> enumInstances)Convert a list ofomero.model.enumsinstances to their correspondingStringvalues.static java.lang.StringgetDisplayedFileName(java.lang.String fullPath, java.lang.Integer number)Returns the name to display for a file.static java.lang.StringgetFolderAsContainerName(java.io.File file)Returns the name as container if option is on.static java.lang.StringgetStringSeparator(java.lang.String originalName)Returns the separator ornull.static booleanisBlank(java.lang.String s)static java.lang.String[]splitString(java.lang.String originalName)Returns the partial name of the image's namestatic <E extends omero.model.IObject,I extends E>
java.util.List<E>toEnum(java.lang.Class<E> enumClass, java.lang.Class<I> instanceClass, java.util.Collection<java.lang.String> enumValues)Convert a list ofStringvalues to their correspondingomero.model.enumsinstances.
-
-
-
Method Detail
-
getFolderAsContainerName
public static java.lang.String getFolderAsContainerName(java.io.File file)
Returns the name as container if option is on.- Returns:
- See above.
-
getDisplayedFileName
public static java.lang.String getDisplayedFileName(java.lang.String fullPath, java.lang.Integer number)Returns the name to display for a file.- Parameters:
fullPath- The file's absolute path.number- The number of folder to set the name.- Returns:
- See above.
-
splitString
public static java.lang.String[] splitString(java.lang.String originalName)
Returns the partial name of the image's name- Parameters:
originalName- The original name.- Returns:
- See above.
-
getStringSeparator
public static java.lang.String getStringSeparator(java.lang.String originalName)
Returns the separator ornull.- Parameters:
originalName- The original name.- Returns:
- See above.
-
toEnum
public static <E extends omero.model.IObject,I extends E> java.util.List<E> toEnum(java.lang.Class<E> enumClass, java.lang.Class<I> instanceClass, java.util.Collection<java.lang.String> enumValues) throws java.lang.ReflectiveOperationExceptionConvert a list ofStringvalues to their correspondingomero.model.enumsinstances.- Parameters:
enumClass- the desired enumeration type, nevernullinstanceClass- the type whose no-argument constructor is used to provide instances ofenumClassenumValues- values of the enumeration type, nevernullnor with anullvalue- Returns:
- enumeration instances of the given type with the given values
- Throws:
java.lang.ReflectiveOperationException- if the instances could not be created
-
fromEnum
public static <E extends omero.model.IObject> java.util.List<java.lang.String> fromEnum(java.util.Collection<E> enumInstances) throws java.lang.ReflectiveOperationExceptionConvert a list ofomero.model.enumsinstances to their correspondingStringvalues.- Parameters:
enumInstances- enumeration instances, nevernullnor with anullvalue- Returns:
- values of the given instances, never
null - Throws:
java.lang.ReflectiveOperationException- if the values could not be determined
-
isBlank
public static boolean isBlank(java.lang.String s)
-
-