Package org.eclipse.core.runtime
Class MultiStatus
- java.lang.Object
-
- org.eclipse.core.runtime.Status
-
- org.eclipse.core.runtime.MultiStatus
-
-
Constructor Summary
Constructors Constructor Description MultiStatus(Class<?> caller, int code, String message)Creates and returns a new multi-status object with no children.MultiStatus(Class<?> caller, int code, String message, Throwable exception)Creates and returns a new multi-status object with no children.MultiStatus(Class<?> caller, int code, IStatus[] newChildren, String message, Throwable exception)Creates and returns a new multi-status object with the given children.MultiStatus(String pluginId, int code, String message)Creates and returns a new multi-status object with no children.MultiStatus(String pluginId, int code, String message, Throwable exception)Creates and returns a new multi-status object with no children.MultiStatus(String pluginId, int code, IStatus[] newChildren, String message, Throwable exception)Creates and returns a new multi-status object with the given children.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(IStatus status)Adds the given status to this multi-status.voidaddAll(IStatus status)Adds all of the children of the given status to this multi-status.IStatus[]getChildren()Returns a list of status object immediately contained in this multi-status, or an empty list if this is not a multi-status.booleanisMultiStatus()Returns whether this status is a multi-status.voidmerge(IStatus status)Merges the given status into this multi-status.StringtoString()Returns a string representation of the status, suitable for debugging purposes only.-
Methods inherited from class org.eclipse.core.runtime.Status
error, error, getCode, getException, getMessage, getPlugin, getSeverity, info, isOK, matches, setCode, setException, setMessage, setPlugin, setSeverity, warning, warning
-
-
-
-
Constructor Detail
-
MultiStatus
public MultiStatus(Class<?> caller, int code, IStatus[] newChildren, String message, Throwable exception)
Creates and returns a new multi-status object with the given children.- Parameters:
caller- the relevant class to build unique identifier fromcode- the caller-specific status codenewChildren- the list of children status objectsmessage- a human-readable message, localized to the current localeexception- a low-level exception, ornullif not applicable- Since:
- 3.12
-
MultiStatus
public MultiStatus(String pluginId, int code, IStatus[] newChildren, String message, Throwable exception)
Creates and returns a new multi-status object with the given children.- Parameters:
pluginId- the unique identifier of the relevant plug-incode- the plug-in-specific status codenewChildren- the list of children status objectsmessage- a human-readable message, localized to the current localeexception- a low-level exception, ornullif not applicable
-
MultiStatus
public MultiStatus(Class<?> caller, int code, String message, Throwable exception)
Creates and returns a new multi-status object with no children.- Parameters:
caller- the relevant class to build unique identifier fromcode- the caller-specific status codemessage- a human-readable message, localized to the current localeexception- a low-level exception, ornullif not applicable- Since:
- 3.12
-
MultiStatus
public MultiStatus(String pluginId, int code, String message, Throwable exception)
Creates and returns a new multi-status object with no children.- Parameters:
pluginId- the unique identifier of the relevant plug-incode- the plug-in-specific status codemessage- a human-readable message, localized to the current localeexception- a low-level exception, ornullif not applicable
-
MultiStatus
public MultiStatus(Class<?> caller, int code, String message)
Creates and returns a new multi-status object with no children.- Parameters:
caller- the relevant class to build unique identifier fromcode- the caller-specific status codemessage- a human-readable message, localized to the current locale- Since:
- 3.12
-
MultiStatus
public MultiStatus(String pluginId, int code, String message)
Creates and returns a new multi-status object with no children.- Parameters:
pluginId- the unique identifier of the relevant plug-incode- the plug-in-specific status codemessage- a human-readable message, localized to the current locale- Since:
- 3.11
-
-
Method Detail
-
add
public void add(IStatus status)
Adds the given status to this multi-status.- Parameters:
status- the new child status
-
addAll
public void addAll(IStatus status)
Adds all of the children of the given status to this multi-status. Does nothing if the given status has no children (which includes the case where it is not a multi-status).- Parameters:
status- the status whose children are to be added to this one
-
getChildren
public IStatus[] getChildren()
Description copied from interface:IStatusReturns a list of status object immediately contained in this multi-status, or an empty list if this is not a multi-status.- Specified by:
getChildrenin interfaceIStatus- Overrides:
getChildrenin classStatus- Returns:
- an array of status objects
- See Also:
IStatus.isMultiStatus()
-
isMultiStatus
public boolean isMultiStatus()
Description copied from interface:IStatusReturns whether this status is a multi-status. A multi-status describes the outcome of an operation involving multiple operands.The severity of a multi-status is derived from the severities of its children; a multi-status with no children is
OKby definition. A multi-status carries a plug-in identifier, a status code, a message, and an optional exception. Clients may treat multi-status objects in a multi-status unaware way.- Specified by:
isMultiStatusin interfaceIStatus- Overrides:
isMultiStatusin classStatus- Returns:
truefor a multi-status,falseotherwise- See Also:
IStatus.getChildren()
-
merge
public void merge(IStatus status)
Merges the given status into this multi-status. Equivalent toadd(status)if the given status is not a multi-status. Equivalent toaddAll(status)if the given status is a multi-status.- Parameters:
status- the status to merge into this one- See Also:
add(IStatus),addAll(IStatus)
-
-