|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.hivemind.HiveMind
Static utility class for HiveMind.
Field Summary | |
static java.lang.String |
THREAD_EVENT_NOTIFIER_SERVICE
The full id of the ThreadEventNotifier
service. |
Method Summary | |
static void |
checkFactoryParameterCount(java.lang.String extensionPointId,
java.util.List parameters,
int expectedCount)
Checks that the number of parameters provided to a service implementation factory matches the expected number. |
static void |
checkNullParameter(java.lang.String parameterName,
java.lang.Object value)
Checks if the value (a constructor or method parameter) is null, and throws an InvalidArgumentException if so. |
static ApplicationRuntimeException |
createRegistryShutdownException()
|
static Location |
findLocation(java.lang.Object[] locations)
Selects the first Location in an array of objects. |
static Location |
getLocation(java.lang.Object object)
Extracts a location from an object, checking to see if it implement Location or Locatable . |
static java.lang.String |
getLocationString(java.lang.Object object)
Invokes getLocation(Object) , then translate the result
to a string value, or "unknown location" if null. |
static boolean |
isBlank(java.lang.String string)
Returns true if the string is null, empty, or contains only whitespace. |
static boolean |
isEmpty(java.util.Collection c)
Returns true if the Collection is null or empty. |
static boolean |
isNonBlank(java.lang.String string)
As with isBlank(String) , but inverts the response. |
static void |
setLocation(java.lang.Object holder,
Location location)
Updates the location of an object, if the object implements LocationHolder . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String THREAD_EVENT_NOTIFIER_SERVICE
ThreadEventNotifier
service.
Method Detail |
public static void checkFactoryParameterCount(java.lang.String extensionPointId, java.util.List parameters, int expectedCount)
extensionPointId
- the id of the service implementation factory (used in the error message)parameters
- the actual parametersexpectedCount
- the expected number of parameters (usually, 1)
ApplicationRuntimeException
- if the actual and expected counts differ.public static ApplicationRuntimeException createRegistryShutdownException()
public static Location findLocation(java.lang.Object[] locations)
Location
in an array of objects.
Skips over nulls. The objects may be instances of
Location or Locatable
. May return null
if no Location can be found.
public static Location getLocation(java.lang.Object object)
Location
or Locatable
.
public static java.lang.String getLocationString(java.lang.Object object)
getLocation(Object)
, then translate the result
to a string value, or "unknown location" if null.
public static boolean isBlank(java.lang.String string)
The commons-lang library provides a version of this, but the naming and behavior changed between 1.0 and 2.0, which causes some dependency issues.
public static boolean isNonBlank(java.lang.String string)
isBlank(String)
, but inverts the response.
public static void setLocation(java.lang.Object holder, Location location)
LocationHolder
.
holder
- the object to be updatedlocation
- the location to assign to the holder objectpublic static void checkNullParameter(java.lang.String parameterName, java.lang.Object value)
public static boolean isEmpty(java.util.Collection c)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |