@FunctionalInterface public interface FluentProperty extends SerializableLambda
Example of a component which provides fluent properties {"foo"="bar"; "foo2"=Integer(123)}:
public class Activator extends DependencyManagerActivator {
public void init(BundleContext ctx, DependencyManager dm) throws Exception {
component(comp -> comp.impl(MyComponentImpl.class).provides(MyService.class, foo->"bar", foo2 -> 123));
}
}
Caution: Fluent properties requires the usage of the "-parameter" javac option.
Under eclipse, you can enable this option using:
Windows -> Preference -> Compiler -> Classfile Generation -> Store information about method parameters.
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
apply(java.lang.String name)
Represents a fluent property
|