Package de.olivergierke.whoops.domain.customer

Examples of de.olivergierke.whoops.domain.customer.CustomerNumber


  public Customer createCustomer(String firstname, String lastname) {

    Assert.hasText(firstname, "Firstname must not be null or empty!");
    Assert.hasText(lastname, "Lastname must not be null or empty!");

    CustomerNumber number = generator.generateCustomerNumber();
    Customer customer = new Customer(firstname, lastname, number);

    return repository.save(customer);
  }
View Full Code Here


    for (int i = 0; i < CustomerNumber.LENGTH; i++) {
      buffer.append(alphabet.charAt(random.nextInt(alphabet.length())));
    }

    return new CustomerNumber(buffer.toString());
  }
View Full Code Here

TOP

Related Classes of de.olivergierke.whoops.domain.customer.CustomerNumber

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.