Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class UserBuilder {
- constructor() {
- this.user = {};
- }
- setLogin(login) {
- this.user.login = login;
- return this;
- }
- setPassword(password) {
- this.user.password = password;
- return this;
- }
- setFirstName(firstName) {
- this.user.firstName = firstName;
- return this;
- }
- setLastName(lastName) {
- this.user.lastName = lastName;
- return this;
- }
- setEmail(email) {
- this.user.email = email;
- return this;
- }
- setTelephone(telephone) {
- this.user.telephone = telephone;
- return this;
- }
- setAddress(address) {
- this.user.address = address;
- return this;
- }
- setCity(city) {
- this.user.city = city;
- return this;
- }
- setPostCode(postCode) {
- this.user.postCode = postCode;
- return this;
- }
- setCountry(country) {
- this.user.country = country;
- return this;
- }
- setRegion(region) {
- this.user.region = region;
- return this;
- }
- build() {
- return this.user;
- }
- }
- module.exports = UserBuilder;
Advertisement
Add Comment
Please, Sign In to add comment