Skip to content
Daan van Yperen edited this page Sep 17, 2016 · 3 revisions

Annotation that customizes how the fluid generator processes your component. It will be picked up from superclasses (but not interfaces).

Make getters chainable

When you have parameterized getters you sometimes want it to chain on the fluid interface, instead of returning the value. You can achieve this by using the @Fluid annotation.

@Fluid(swallowGettersWithParameters=true)
class Rocket extends Component {
    public Rocket copy(Rocket rocket);
}

Will change Rocket E::rocketCopy(Rocket rocket) into E E::rocketCopy(Rocket rocket) (it returns E so you can continue calling methods on E).

Override name

You can change the prefix on your component methods.

@Fluid(name="myRocket")
class Rocket extends Component {
  public int size;
}

Will become E(id).myRocket().myRocketSize(10).removeMyRocket()

Exclude component

To exclude a component completely from the fluid interface:

@Fluid(exclude=true)
class NotExposed extends Component {
  ..
}
Clone this wiki locally