org.knopflerfish.service.console
public class Util extends java.lang.Object
| Constructor and Description |
|---|
Util() |
| Modifier and Type | Method and Description |
|---|---|
static void |
selectBundles(Bundle[] bundles,
java.lang.String[] selection)
Select bundles from an array of Bundle objects.
|
static void |
selectBundles(Bundle[] bundles,
java.lang.String[] selection,
java.util.Set<java.lang.String> selectionMatches)
Select bundles from an array of Bundle objects.
|
static java.lang.String |
shortName(Bundle bundle)
Get short name of specified bundle.
|
static java.lang.String |
showId(Bundle bundle)
Get bundle identifier as a constant length string.
|
static java.lang.String |
showLeft(int width,
java.lang.String str)
Show a string left adjusted in constant length string.
|
static java.lang.String |
showObject(java.lang.Object o)
Get string representation of an object.
|
static java.lang.String |
showRight(int width,
java.lang.String str)
Show a string right adjusted in constant length string.
|
static java.lang.String |
showServiceClasses(ServiceReference<?> sr)
Get Service class list as a string.
|
static java.lang.String |
showState(Bundle bundle)
Get bundle state as a constant length string.
|
static void |
sortBundles(Bundle[] b,
boolean longName)
Sort an array of bundle objects based on their location or shortname.
|
static void |
sortBundlesId(Bundle[] b)
Sort an array of bundle objects based on their Bundle Id.
|
static void |
sortBundlesTime(Bundle[] b)
Sort an array of bundle objects based on their Last modified time.
|
static java.lang.String |
symbolicName(Bundle bundle)
Get the symbolic name of the specified bundle.
|
public static void selectBundles(Bundle[] bundles, java.lang.String[] selection)
bundles - array of bundles to be checked, modified with resultselection - array of selection string to match against bundlespublic static void selectBundles(Bundle[] bundles, java.lang.String[] selection, java.util.Set<java.lang.String> selectionMatches)
bundles - array of bundles to be checked, modified with resultselection - array of selection string to match against bundlesselectionMatches - Each patterns from selection array that matches a bundle will be
added to this set.public static void sortBundles(Bundle[] b, boolean longName)
b - array of bundles to be sorted, modified with resultlongName - if true sort on location otherwise on shortnamepublic static void sortBundlesId(Bundle[] b)
b - array of bundles to be sorted, modified with resultpublic static void sortBundlesTime(Bundle[] b)
b - array of bundles to be sorted, modified with resultpublic static java.lang.String shortName(Bundle bundle)
bundle - the bundlepublic static java.lang.String symbolicName(Bundle bundle)
bundle - the bundlepublic static java.lang.String showState(Bundle bundle)
bundle - the bundlepublic static java.lang.String showId(Bundle bundle)
bundle - the bundlepublic static java.lang.String showServiceClasses(ServiceReference<?> sr)
sr - The servicepublic static java.lang.String showObject(java.lang.Object o)
o - the object to showpublic static java.lang.String showLeft(int width,
java.lang.String str)
str - the object to showwidth - the desired width of the resultpublic static java.lang.String showRight(int width,
java.lang.String str)
str - the object to showwidth - the desired width of the result