@Override public void updateName( String newName ) { name().set( newName ); } }
public static Property<Long> add( Property<Long> property, long amount ) { property.set( property.get() + amount ); return property; }
public static Property<Long> mult( Property<Long> property, long amount ) { property.set( property.get() * amount ); return property; }
public static Property<BigDecimal> mult( Property<BigDecimal> property, BigDecimal amount ) { property.set( property.get().multiply( amount ) ); return property; }
public static Property<BigDecimal> div( Property<BigDecimal> property, BigDecimal amount ) { property.set( property.get().divide( amount ) ); return property; } }
@Override public void updateName( String newName ) { name().set( newName ); } }
@Override public void updateName( String newName ) { name().set( newName ); } }
public static Property<Long> div( Property<Long> property, long amount ) { property.set( property.get() / amount ); return property; }
public static Property<Double> div( Property<Double> property, double amount ) { property.set( property.get() / amount ); return property; }
public static Property<Float> sub( Property<Float> property, float amount ) { property.set( property.get() - amount ); return property; }
public static Property<Float> div( Property<Float> property, float amount ) { property.set( property.get() / amount ); return property; }
public static Property<BigDecimal> add( Property<BigDecimal> property, BigDecimal amount ) { property.set( property.get().add( amount ) ); return property; }
private static BarEntity buildBarEntity( Module module, UnitOfWork uow, String cathedral ) { EntityBuilder<BarEntity> barBuilder = uow.newEntityBuilder( BarEntity.class ); barBuilder.instance().cathedral().set( cathedral ); barBuilder.instance().another().set( createAnotherValue( module, "nested", "value" ) ); return barBuilder.newInstance(); }
@Override public void rename( Identity id, String newName ) { module.unitOfWorkFactory().currentUnitOfWork().get( Person.class, id ).name().set( newName ); }
public Rent create( int amount, String currency ) { ValueBuilder<Rent> builder = vbf.newValueBuilder( Rent.class ); builder.prototype().amount().set( currencyBuilder.create( amount, currency ) ); return builder.newInstance(); } }
@Override public Country createCountry( String countryCode, String countryName ) { UnitOfWork uow = uowf.currentUnitOfWork(); EntityBuilder<Country> builder = uow.newEntityBuilder( Country.class, identityOf( "country-" + countryCode ) ); builder.instance().name().set( countryName ); return builder.newInstance(); }
/** * @return a Some ValueComposite whose state is populated with test data. */ protected static Some buildSomeValue( Module module, UnitOfWork uow, String identity ) { ValueBuilder<Some> builder = module.newValueBuilder( Some.class ); Some proto = builder.prototype(); proto.identity().set( StringIdentity.identityOf( identity ) ); setSomeValueState( module, uow, proto ); return builder.newInstance(); }
private WillPercentage createPercentage( Person beneficiary, Float percentage ) { ValueBuilder<WillPercentage> builder = vbf.newValueBuilder( WillPercentage.class ); builder.prototype().percentage().set( percentage ); builder.prototype().beneficiary().set( beneficiary ); return builder.newInstance(); }
private WillAmount createAmount( Person beneficiary, Currency amount ) { ValueBuilder<WillAmount> builder = vbf.newValueBuilder( WillAmount.class ); builder.prototype().amount().set( amount ); builder.prototype().beneficiary().set( beneficiary ); return builder.newInstance(); }