Pax Exam

Support optional sets of options

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 0.5.0
  • Component/s: Core
  • Labels:
    None

Description

There are cases when set of option shall be included into configurations based on some arbitrary conditions. For example in case that a system property has a certain value.
To support this use cases a composite option could be used that will include the options that makes up the composite only in case that a condition evaluates to TRUE.
E.g.: in the following example the system property option "foo=bar" will be included only when includeFooProperty is set:

@Configuration
public static Option[] configureWhenUserHomeIsSet()
{
    return options(
        when( System.getProperty( "includeFooProperty" ) != null ).useOptions(
            systemProperty( "foo" ).value( "bar" )
        )
    );
}

Issue Links

Activity

Hide
Alin Dreghiciu added a comment -

Released as part of 0.5.0

Show
Alin Dreghiciu added a comment - Released as part of 0.5.0

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: