public class EclipseUtil extends Object
Modifier and Type | Method and Description |
---|---|
static <L,I extends L> |
addToList(List<L> list,
I item)
Convenience method to add an item to a list.
|
static org.eclipse.core.runtime.CoreException |
createCoreException(Throwable failure)
Creates a
CoreException from the input Throwable . |
static <T> T |
createInstance(Class<T> clazz,
AbstractOfficeFloorEditor<?,?> editor)
Creates an instance of the class.
|
static <S> S |
createInstance(String className,
Class<S> superType,
AbstractOfficeFloorEditor<?,?> editor)
Convenience method to create an instance of a class by its name.
|
static boolean |
isBlank(String value)
Utility method to indicate if the input
String is
null or empty. |
static <S> Class<S> |
obtainClass(String className,
Class<S> superType,
AbstractOfficeFloorEditor<?,?> editor)
Obtains the
Class by its name. |
public static boolean isBlank(String value)
String
is
null
or empty.value
- Value to check if blank.null
or empty.public static <S> Class<S> obtainClass(String className, Class<S> superType, AbstractOfficeFloorEditor<?,?> editor)
Class
by its name.S
- Super type.className
- Fully qualified name of the class.superType
- Type that the class must be a sub type.editor
- AbstractOfficeFloorEditor
to report issues.Class
or null
if could not obtain.public static <T> T createInstance(Class<T> clazz, AbstractOfficeFloorEditor<?,?> editor)
T
- Type.clazz
- Class to create an instance from.editor
- AbstractOfficeFloorEditor
to report issues.null
if unable to
instantiate.public static <S> S createInstance(String className, Class<S> superType, AbstractOfficeFloorEditor<?,?> editor)
S
- Super type.className
- Fully qualified name of class.superType
- Type that the class of instance must be a sub type.editor
- AbstractOfficeFloorEditor
to report issues.null
if unable to instantiate.public static org.eclipse.core.runtime.CoreException createCoreException(Throwable failure)
CoreException
from the input Throwable
.failure
- Throwable
.CoreException
.public static <L,I extends L> void addToList(List<L> list, I item)
null
.L
- Element type of list.I
- Element type.list
- List.item
- Item to be added to the list. Will not be added if
null
.Copyright © 2005–2016. All rights reserved.