All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.vendasta.accountgroup.v1.internal.AccountGroupLocation Maven / Gradle / Ivy

The newest version!
package com.vendasta.accountgroup.v1.internal;

import java.util.List;
import java.util.ArrayList;
import java.util.Date;
import java.util.Map;
import java.util.HashMap;
import java.util.Collections;
import java.util.Arrays;
import java.time.Duration;
import org.apache.commons.lang3.StringUtils;
import com.vendasta.accountgroup.v1.generated.ApiProto;

/**
 * 
 **/
public final class AccountGroupLocation {




	private final String companyName;
	private final String address;
	private final String address2;
	private final String city;
	private final String state;
	private final String zip;
	private final String country;
	private final String website;
	private final List workNumber;
	private final List callTrackingNumber;
	private final Geo location;
	private final String timezone;
	private final boolean serviceAreaBusiness;
	

	private AccountGroupLocation (
		final String companyName,
		final String address,
		final String address2,
		final String city,
		final String state,
		final String zip,
		final String country,
		final String website,
		final List workNumber,
		final List callTrackingNumber,
		final Geo location,
		final String timezone,
		final boolean serviceAreaBusiness)
		
	{
		this.companyName = companyName;
		this.address = address;
		this.address2 = address2;
		this.city = city;
		this.state = state;
		this.zip = zip;
		this.country = country;
		this.website = website;
		this.workNumber = workNumber;
		this.callTrackingNumber = callTrackingNumber;
		this.location = location;
		this.timezone = timezone;
		this.serviceAreaBusiness = serviceAreaBusiness;
		
	}
	
	/**
	 * 
      * @return The final value of companyName on the object
	 **/
	public String getCompanyName() {
		return this.companyName;
	}
	
	/**
	 * 
      * @return The final value of address on the object
	 **/
	public String getAddress() {
		return this.address;
	}
	
	/**
	 * 
      * @return The final value of address2 on the object
	 **/
	public String getAddress2() {
		return this.address2;
	}
	
	/**
	 * 
      * @return The final value of city on the object
	 **/
	public String getCity() {
		return this.city;
	}
	
	/**
	 * 
      * @return The final value of state on the object
	 **/
	public String getState() {
		return this.state;
	}
	
	/**
	 * 
      * @return The final value of zip on the object
	 **/
	public String getZip() {
		return this.zip;
	}
	
	/**
	 * 
      * @return The final value of country on the object
	 **/
	public String getCountry() {
		return this.country;
	}
	
	/**
	 * 
      * @return The final value of website on the object
	 **/
	public String getWebsite() {
		return this.website;
	}
	
	/**
	 * 
      * @return The final value of workNumber on the object
	 **/
	public List getWorkNumber() {
		return this.workNumber;
	}
	
	/**
	 * 
      * @return The final value of callTrackingNumber on the object
	 **/
	public List getCallTrackingNumber() {
		return this.callTrackingNumber;
	}
	
	/**
	 * 
      * @return The final value of location on the object
	 **/
	public Geo getLocation() {
		return this.location;
	}
	
	/**
	 * 
      * @return The final value of timezone on the object
	 **/
	public String getTimezone() {
		return this.timezone;
	}
	
	/**
	 * 
      * @return The final value of serviceAreaBusiness on the object
	 **/
	public boolean getServiceAreaBusiness() {
		return this.serviceAreaBusiness;
	}
	

	public static class Builder {
		private String companyName;
		private String address;
		private String address2;
		private String city;
		private String state;
		private String zip;
		private String country;
		private String website;
		private List workNumber;
		private List callTrackingNumber;
		private Geo location;
		private String timezone;
		private boolean serviceAreaBusiness;
		
		public Builder() {
			this.companyName = "";
			this.address = "";
			this.address2 = "";
			this.city = "";
			this.state = "";
			this.zip = "";
			this.country = "";
			this.website = "";
			this.workNumber = new ArrayList();
			this.callTrackingNumber = new ArrayList();
			this.location = null;
			this.timezone = "";
			this.serviceAreaBusiness = false;
			
		}
		
		/**
		  * Adds a value to the builder for companyName
		  * @param companyName Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setCompanyName(String companyName) {
			this.companyName = companyName;
			return this;
		}
		
		/**
		  * Adds a value to the builder for address
		  * @param address Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setAddress(String address) {
			this.address = address;
			return this;
		}
		
		/**
		  * Adds a value to the builder for address2
		  * @param address2 Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setAddress2(String address2) {
			this.address2 = address2;
			return this;
		}
		
		/**
		  * Adds a value to the builder for city
		  * @param city Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setCity(String city) {
			this.city = city;
			return this;
		}
		
		/**
		  * Adds a value to the builder for state
		  * @param state Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setState(String state) {
			this.state = state;
			return this;
		}
		
		/**
		  * Adds a value to the builder for zip
		  * @param zip Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setZip(String zip) {
			this.zip = zip;
			return this;
		}
		
		/**
		  * Adds a value to the builder for country
		  * @param country Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setCountry(String country) {
			this.country = country;
			return this;
		}
		
		/**
		  * Adds a value to the builder for website
		  * @param website Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setWebsite(String website) {
			this.website = website;
			return this;
		}
		
		/**
		  * Adds a value to the builder for workNumber
		  * @param workNumber Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setWorkNumber(List workNumber) {
			this.workNumber = workNumber;
			return this;
		}
		
		/**
		  * Adds a value to the builder for callTrackingNumber
		  * @param callTrackingNumber Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setCallTrackingNumber(List callTrackingNumber) {
			this.callTrackingNumber = callTrackingNumber;
			return this;
		}
		
		/**
		  * Adds a value to the builder for location
		  * @param location Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setLocation(Geo location) {
			this.location = location;
			return this;
		}
		
		/**
		  * Adds a value to the builder for timezone
		  * @param timezone Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setTimezone(String timezone) {
			this.timezone = timezone;
			return this;
		}
		
		/**
		  * Adds a value to the builder for serviceAreaBusiness
		  * @param serviceAreaBusiness Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setServiceAreaBusiness(boolean serviceAreaBusiness) {
			this.serviceAreaBusiness = serviceAreaBusiness;
			return this;
		}
		
		/**
		  * Takes the configuration in the mutable Builder and uses it to instantiate a final instance
		  * of the AccountGroupLocation class
		  * @return The instantiated final AccountGroupLocation
		 **/
		public AccountGroupLocation build() {
			return new AccountGroupLocation(
				this.companyName,
				this.address,
				this.address2,
				this.city,
				this.state,
				this.zip,
				this.country,
				this.website,
				this.workNumber,
				this.callTrackingNumber,
				this.location,
				this.timezone,
				this.serviceAreaBusiness);
		}
	}

	/**
	 * Returns a Builder for AccountGroupLocation, which is a mutable representation of the object.  Once the
	 * client has built up an object they can then create an immutable AccountGroupLocation object using the
	 * build function.
	 * @return A fresh Builder instance with no values set
	 **/
	public static Builder newBuilder() {
		return new Builder();
	}

	/**
	 * Provides a human-readable representation of this object.  Useful for debugging.
	 * @return A string representation of the AccountGroupLocation instance
	 **/
	 public String toString() {
		 String result = "AccountGroupLocation\n";
		 result += "-> companyName: (String)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.companyName).split("\n"))) + "\n"; 
		 result += "-> address: (String)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.address).split("\n"))) + "\n"; 
		 result += "-> address2: (String)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.address2).split("\n"))) + "\n"; 
		 result += "-> city: (String)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.city).split("\n"))) + "\n"; 
		 result += "-> state: (String)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.state).split("\n"))) + "\n"; 
		 result += "-> zip: (String)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.zip).split("\n"))) + "\n"; 
		 result += "-> country: (String)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.country).split("\n"))) + "\n"; 
		 result += "-> website: (String)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.website).split("\n"))) + "\n"; 
		 result += "-> workNumber: (List)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.workNumber).split("\n"))) + "\n"; 
		 result += "-> callTrackingNumber: (List)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.callTrackingNumber).split("\n"))) + "\n"; 
		 result += "-> location: (Geo)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.location).split("\n"))) + "\n"; 
		 result += "-> timezone: (String)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.timezone).split("\n"))) + "\n"; 
		 result += "-> serviceAreaBusiness: (boolean)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.serviceAreaBusiness).split("\n"))) + "\n"; 
		 
		 return result;
	 }
	/**
	* Allows for simple conversion between the low-level generated protobuf object to
	* AccountGroupLocation, which is much more usable.
	* @return An instance of AccountGroupLocation representing the input proto object
	**/
	public static AccountGroupLocation fromProto(ApiProto.AccountGroupLocation proto) {
		AccountGroupLocation out = null;
		if (proto != null) {
			AccountGroupLocation.Builder outBuilder = AccountGroupLocation.newBuilder()
			.setCompanyName(proto.getCompanyName())
			.setAddress(proto.getAddress())
			.setAddress2(proto.getAddress2())
			.setCity(proto.getCity())
			.setState(proto.getState())
			.setZip(proto.getZip())
			.setCountry(proto.getCountry())
			.setWebsite(proto.getWebsite())
			.setWorkNumber(proto.getWorkNumberList())
			.setCallTrackingNumber(proto.getCallTrackingNumberList())
			.setLocation(Geo.fromProto(proto.getLocation()))
			.setTimezone(proto.getTimezone())
			.setServiceAreaBusiness(proto.getServiceAreaBusiness());
			out = outBuilder.build();
		}
		return out;
	}

	/**
	* Convenience method for handling lists of proto objects.  It calls .fromProto on each one
	* and returns a list of the converted results.
	* @return A list of AccountGroupLocation instances representing the input proto objects
	**/
	public static List fromProtos(List protos) {
		List out = new ArrayList();
		for(ApiProto.AccountGroupLocation proto : protos) {
			out.add(AccountGroupLocation.fromProto(proto));
		}
		return out;
	}

	/**
	 * Allows for simple conversion of an object to the low-level generated protobuf object.
	 * @return An instance of ApiProto.AccountGroupLocation which is a proto object ready for wire transmission
	 **/
	 public ApiProto.AccountGroupLocation toProto() {
		 AccountGroupLocation obj = this;
		 ApiProto.AccountGroupLocation.Builder outBuilder = ApiProto.AccountGroupLocation.newBuilder();
		 outBuilder.setCompanyName(obj.getCompanyName());
		 outBuilder.setAddress(obj.getAddress());
		 outBuilder.setAddress2(obj.getAddress2());
		 outBuilder.setCity(obj.getCity());
		 outBuilder.setState(obj.getState());
		 outBuilder.setZip(obj.getZip());
		 outBuilder.setCountry(obj.getCountry());
		 outBuilder.setWebsite(obj.getWebsite());
		 outBuilder.addAllWorkNumber(obj.getWorkNumber());
		 outBuilder.addAllCallTrackingNumber(obj.getCallTrackingNumber());
		 if(obj.getLocation() != null){outBuilder.setLocation(obj.getLocation().toProto());}
		 outBuilder.setTimezone(obj.getTimezone());
		 outBuilder.setServiceAreaBusiness(obj.getServiceAreaBusiness());
		 return outBuilder.build();
	 }

	 /**
	  * Convenience method for handling lists of objects.  It calls .toProto on each one and
	  * returns a list of the converted results.
	  * @return A list of ApiProto.AccountGroupLocation instances representing the input objects.
	  */
	public static List toProtos(List objects) {
		List out = new ArrayList();
		if(objects != null) {
			for (AccountGroupLocation obj : objects) {
				out.add(obj!=null?obj.toProto():null);
			}
		}
		return out;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy