public class

OptionUtils

extends Object
java.lang.Object
   ↳ org.ops4j.pax.exam.OptionUtils

Class Overview

Utility methods related to Options.

Summary

Public Methods
static Option[] combine(Option[] options1, Option... options2)
Combines two arrays of options in one array containing both provided arrays in order they are provided.
static Option[] expand(Option... options)
Expand options to one level by expanding eventual CompositeOption.
static <T extends Option> T[] filter(Class<T> optionType, Option... options)
Filters the provided options by class returning an array of those option that are instance of the provided class.
static Option[] remove(Class<? extends Option> optionType, Option... options)
Removes from the provided options all options that are instance of the provided class, returning the remaining options.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static Option[] combine (Option[] options1, Option... options2)

Combines two arrays of options in one array containing both provided arrays in order they are provided.

Parameters
options1 array of options (can be null or empty array)
options2 array of options (can be null or empty array)
Returns
  • combined array of options (never null). In case that both arrays are null or empty an empty array is returned

public static Option[] expand (Option... options)

Expand options to one level by expanding eventual CompositeOption. During this process null options are eliminated.

Parameters
options options to be expanded (can be null or an empty array)
Returns
  • expanded options (never null). In case that the options to be expanded is null an empty array is returned

public static T[] filter (Class<T> optionType, Option... options)

Filters the provided options by class returning an array of those option that are instance of the provided class. Before filtering the options are expanded expand(Option[]).

Parameters
optionType class of the desired options
options options to be filtered (can be null or empty array)
Returns
  • array of desired option type (never null). In case that the array of filtered options is null, empty or there is no option that matches the desired type an empty array is returned

public static Option[] remove (Class<? extends Option> optionType, Option... options)

Removes from the provided options all options that are instance of the provided class, returning the remaining options.

Parameters
optionType class of the desired options to be removed
options options to be filtered (can be null or empty array)
Returns
  • array of remaining options (never null) after removing the desired type