pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.component.shop.checkout
Class Customer.CustomerBuilder

java.lang.Object
  extended by org.torweg.pulse.component.shop.checkout.Customer.CustomerBuilder
Enclosing class:
Customer

public static class Customer.CustomerBuilder
extends java.lang.Object

The CustomerBuilder.

Version:
$Revision: 1979 $
Author:
Christian Schatt

Constructor Summary
Customer.CustomerBuilder()
          The no-argument constructor used for processing forms.
Customer.CustomerBuilder(java.lang.Long uid, java.lang.String ea)
          Creates a new CustomerBuilder from the given user id and email address.
Customer.CustomerBuilder(User u)
          Creates a new CustomerBuilder from the given User.
 
Method Summary
 Customer build()
          Builds a new Customer.
 java.lang.String getEmailAddress()
          Returns the email address.
 java.lang.Long getUserId()
          Returns the user id.
 java.lang.String getVATNumber()
          Returns the VAT (value added tax) number.
 Customer.CustomerBuilder setEmailAddress(java.lang.String ea)
          Sets the email address.
 Customer.CustomerBuilder setUserId(java.lang.Long uid)
          Sets the user id.
 Customer.CustomerBuilder setVATNumber(java.lang.String vatn)
          Sets the VAT (value added tax) number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Customer.CustomerBuilder

public Customer.CustomerBuilder()
The no-argument constructor used for processing forms.


Customer.CustomerBuilder

public Customer.CustomerBuilder(User u)
Creates a new CustomerBuilder from the given User.

Parameters:
u - the User.
Throws:
java.lang.IllegalArgumentException - if the given User is null or an instance of Everybody.

Customer.CustomerBuilder

public Customer.CustomerBuilder(java.lang.Long uid,
                                java.lang.String ea)
Creates a new CustomerBuilder from the given user id and email address.

Parameters:
uid - the user id.
ea - the email address.
Throws:
java.lang.IllegalArgumentException - if the given email address is null.
Method Detail

getUserId

public final java.lang.Long getUserId()
Returns the user id.

Returns:
the user id.

setUserId

public final Customer.CustomerBuilder setUserId(java.lang.Long uid)
Sets the user id.

Parameters:
uid - the user id to set.
Returns:
this.

getEmailAddress

public final java.lang.String getEmailAddress()
Returns the email address.

Returns:
the email address.

setEmailAddress

public final Customer.CustomerBuilder setEmailAddress(java.lang.String ea)
Sets the email address.

Parameters:
ea - the email address to set.
Returns:
this.
Throws:
java.lang.IllegalArgumentException - if the given email address is null.

getVATNumber

public final java.lang.String getVATNumber()
Returns the VAT (value added tax) number.

Returns:
the VAT number.

setVATNumber

public final Customer.CustomerBuilder setVATNumber(java.lang.String vatn)
Sets the VAT (value added tax) number.

Parameters:
vatn - the VAT number to set.
Returns:
this.

build

public final Customer build()
Builds a new Customer.

Returns:
the new Customer.
Throws:
java.lang.IllegalStateException - if the email address is null.