GNDMS 0.6.0
RESTful verison of GNDMS
|
A PersistenContract can be transformed to an Quote. More...
Inherits java::io::Serializable.
Public Member Functions | |
void | mold (final @NotNull PersistentContract instance) |
Static Public Member Functions | |
static PersistentContract | acceptQuoteAt (DateTime dt, Quote quote) |
static PersistentContract | acceptQuoteNow (Quote quote) |
Static Protected Member Functions | |
static PersistentContract | acceptQuoteAsIs (Quote quote) |
Creates a persistent-contract form this contract by fixing future time using the accepted time stamp. | |
Private Attributes | |
DateTime | accepted |
DateTime | deadline |
DateTime | resultValidity |
Long | expectedSize |
Static Private Attributes | |
static final long | serialVersionUID = -7695057432890400329L |
A PersistenContract can be transformed to an Quote.
User: stepn Date: 24.11.2008 Time: 15:22:43
static PersistentContract de.zib.gndms.model.common.PersistentContract.acceptQuoteAsIs | ( | Quote | quote | ) | [static, protected] |
Creates a persistent-contract form this contract by fixing future time using the accepted time stamp.
todo maybe set fixed values here
quote |
{ PersistentContract pc = new PersistentContract(); pc.setAccepted( quote.getAccepted() ); DateTime fixedDeadline = null; if ( quote.hasDeadline() ) { fixedDeadline = quote.getDeadline().fixedWith( quote.getAccepted() ).getFixedTime(); pc.setDeadline( fixedDeadline ); } if ( quote.hasResultValidity() ) { DateTime fixedResultValidity; if ( fixedDeadline != null ) fixedResultValidity = quote.getResultValidity().fixedWith( fixedDeadline ).getFixedTime(); else { fixedResultValidity = quote.getResultValidity().fixedWith( quote.getAccepted() ).getFixedTime(); } pc.setResultValidity( fixedResultValidity ); } if ( quote.hasExpectedSize() ) pc.setExpectedSize( quote.getExpectedSize() ); return pc; }
void de.zib.gndms.model.common.PersistentContract.mold | ( | final @NotNull PersistentContract | instance | ) |
{ instance.accepted = Copier.copy(true, accepted); instance.deadline = Copier.copy(true, deadline); instance.resultValidity = Copier.copy(true, resultValidity); setExpectedSize(Copier.copy(true, getExpectedSize())); }