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

com.vendasta.accountgroup.v1.internal.HealthCareProfessionalInformation 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 HealthCareProfessionalInformation {

	/**
	 * 
	 **/
	public enum Gender { 
		NotSpecified(0),
			Female(1),
			Male(2),
			Other(3);
		
		private static final Map protoTypeMap;
		static {
			Map aMap;
			aMap = new HashMap();
			aMap.put(ApiProto.HealthCareProfessionalInformation.Gender.NotSpecified, HealthCareProfessionalInformation.Gender.NotSpecified);
			aMap.put(ApiProto.HealthCareProfessionalInformation.Gender.Female, HealthCareProfessionalInformation.Gender.Female);
			aMap.put(ApiProto.HealthCareProfessionalInformation.Gender.Male, HealthCareProfessionalInformation.Gender.Male);
			aMap.put(ApiProto.HealthCareProfessionalInformation.Gender.Other, HealthCareProfessionalInformation.Gender.Other);
			protoTypeMap = Collections.unmodifiableMap(aMap);
		}
	
		private static final Map javaTypeMap;
		static {
			Map aMap;
			aMap = new HashMap();
			aMap.put(HealthCareProfessionalInformation.Gender.NotSpecified, ApiProto.HealthCareProfessionalInformation.Gender.NotSpecified);
			aMap.put(HealthCareProfessionalInformation.Gender.Female, ApiProto.HealthCareProfessionalInformation.Gender.Female);
			aMap.put(HealthCareProfessionalInformation.Gender.Male, ApiProto.HealthCareProfessionalInformation.Gender.Male);
			aMap.put(HealthCareProfessionalInformation.Gender.Other, ApiProto.HealthCareProfessionalInformation.Gender.Other);
			javaTypeMap = Collections.unmodifiableMap(aMap);
		}
	
		private int value;
	
		private Gender(int i) {
			value = i;
		}
		public int getValue() {
			return value;
		}
	
		public static Gender fromProto(ApiProto.HealthCareProfessionalInformation.Gender proto) {
			return protoTypeMap.get(proto);
		}
	
		public static List fromProtos(List protos) {
			List result = new ArrayList();
			for(ApiProto.HealthCareProfessionalInformation.Gender proto : protos) {
				result.add(Gender.fromProto(proto));
			}
			return result;
		}
	
		public ApiProto.HealthCareProfessionalInformation.Gender toProto() {
			return javaTypeMap.get(this);
		}
	
		public static List toProtos(List objects) {
			List result = new ArrayList();
			for(Gender obj : objects) {
				result.add(obj.toProto());
			}
			return result;
		}
	}



	private final Date dateOfBirth;
	private final String email;
	private final List fellowship;
	private final String firstName;
	private final HealthCareProfessionalInformation.Gender gender;
	private final String initials;
	private final List insurancesAccepted;
	private final String lastName;
	private final String medicalLicenseNumber;
	private final String nationalProviderIdentifier;
	private final String office;
	private final List professionalCredential;
	private final List residency;
	private final List school;
	private final List specialty;
	private final String standardizedTitle;
	private final String stateLicense;
	private final com.google.protobuf.BoolValue isTakingPatients;
	

	private HealthCareProfessionalInformation (
		final Date dateOfBirth,
		final String email,
		final List fellowship,
		final String firstName,
		final HealthCareProfessionalInformation.Gender gender,
		final String initials,
		final List insurancesAccepted,
		final String lastName,
		final String medicalLicenseNumber,
		final String nationalProviderIdentifier,
		final String office,
		final List professionalCredential,
		final List residency,
		final List school,
		final List specialty,
		final String standardizedTitle,
		final String stateLicense,
		final com.google.protobuf.BoolValue isTakingPatients)
		
	{
		this.dateOfBirth = dateOfBirth;
		this.email = email;
		this.fellowship = fellowship;
		this.firstName = firstName;
		this.gender = gender;
		this.initials = initials;
		this.insurancesAccepted = insurancesAccepted;
		this.lastName = lastName;
		this.medicalLicenseNumber = medicalLicenseNumber;
		this.nationalProviderIdentifier = nationalProviderIdentifier;
		this.office = office;
		this.professionalCredential = professionalCredential;
		this.residency = residency;
		this.school = school;
		this.specialty = specialty;
		this.standardizedTitle = standardizedTitle;
		this.stateLicense = stateLicense;
		this.isTakingPatients = isTakingPatients;
		
	}
	
	/**
	 * 
      * @return The final value of dateOfBirth on the object
	 **/
	public Date getDateOfBirth() {
		return this.dateOfBirth;
	}
	
	/**
	 * 
      * @return The final value of email on the object
	 **/
	public String getEmail() {
		return this.email;
	}
	
	/**
	 * 
      * @return The final value of fellowship on the object
	 **/
	public List getFellowship() {
		return this.fellowship;
	}
	
	/**
	 * 
      * @return The final value of firstName on the object
	 **/
	public String getFirstName() {
		return this.firstName;
	}
	
	/**
	 * 
      * @return The final value of gender on the object
	 **/
	public HealthCareProfessionalInformation.Gender getGender() {
		return this.gender;
	}
	
	/**
	 * 
      * @return The final value of initials on the object
	 **/
	public String getInitials() {
		return this.initials;
	}
	
	/**
	 * 
      * @return The final value of insurancesAccepted on the object
	 **/
	public List getInsurancesAccepted() {
		return this.insurancesAccepted;
	}
	
	/**
	 * 
      * @return The final value of lastName on the object
	 **/
	public String getLastName() {
		return this.lastName;
	}
	
	/**
	 * 
      * @return The final value of medicalLicenseNumber on the object
	 **/
	public String getMedicalLicenseNumber() {
		return this.medicalLicenseNumber;
	}
	
	/**
	 * 
      * @return The final value of nationalProviderIdentifier on the object
	 **/
	public String getNationalProviderIdentifier() {
		return this.nationalProviderIdentifier;
	}
	
	/**
	 * 
      * @return The final value of office on the object
	 **/
	public String getOffice() {
		return this.office;
	}
	
	/**
	 * 
      * @return The final value of professionalCredential on the object
	 **/
	public List getProfessionalCredential() {
		return this.professionalCredential;
	}
	
	/**
	 * 
      * @return The final value of residency on the object
	 **/
	public List getResidency() {
		return this.residency;
	}
	
	/**
	 * 
      * @return The final value of school on the object
	 **/
	public List getSchool() {
		return this.school;
	}
	
	/**
	 * 
      * @return The final value of specialty on the object
	 **/
	public List getSpecialty() {
		return this.specialty;
	}
	
	/**
	 * 
      * @return The final value of standardizedTitle on the object
	 **/
	public String getStandardizedTitle() {
		return this.standardizedTitle;
	}
	
	/**
	 * 
      * @return The final value of stateLicense on the object
	 **/
	public String getStateLicense() {
		return this.stateLicense;
	}
	
	/**
	 * 
      * @return The final value of isTakingPatients on the object
	 **/
	public com.google.protobuf.BoolValue getIsTakingPatients() {
		return this.isTakingPatients;
	}
	

	public static class Builder {
		private Date dateOfBirth;
		private String email;
		private List fellowship;
		private String firstName;
		private HealthCareProfessionalInformation.Gender gender;
		private String initials;
		private List insurancesAccepted;
		private String lastName;
		private String medicalLicenseNumber;
		private String nationalProviderIdentifier;
		private String office;
		private List professionalCredential;
		private List residency;
		private List school;
		private List specialty;
		private String standardizedTitle;
		private String stateLicense;
		private com.google.protobuf.BoolValue isTakingPatients;
		
		public Builder() {
			this.dateOfBirth = null;
			this.email = "";
			this.fellowship = new ArrayList();
			this.firstName = "";
			this.gender = null;
			this.initials = "";
			this.insurancesAccepted = new ArrayList();
			this.lastName = "";
			this.medicalLicenseNumber = "";
			this.nationalProviderIdentifier = "";
			this.office = "";
			this.professionalCredential = new ArrayList();
			this.residency = new ArrayList();
			this.school = new ArrayList();
			this.specialty = new ArrayList();
			this.standardizedTitle = "";
			this.stateLicense = "";
			this.isTakingPatients = null;
			
		}
		
		/**
		  * Adds a value to the builder for dateOfBirth
		  * @param dateOfBirth Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setDateOfBirth(Date dateOfBirth) {
			this.dateOfBirth = dateOfBirth;
			return this;
		}
		
		/**
		  * Adds a value to the builder for email
		  * @param email Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setEmail(String email) {
			this.email = email;
			return this;
		}
		
		/**
		  * Adds a value to the builder for fellowship
		  * @param fellowship Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setFellowship(List fellowship) {
			this.fellowship = fellowship;
			return this;
		}
		
		/**
		  * Adds a value to the builder for firstName
		  * @param firstName Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setFirstName(String firstName) {
			this.firstName = firstName;
			return this;
		}
		
		/**
		  * Adds a value to the builder for gender
		  * @param gender Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setGender(HealthCareProfessionalInformation.Gender gender) {
			this.gender = gender;
			return this;
		}
		
		/**
		  * Adds a value to the builder for initials
		  * @param initials Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setInitials(String initials) {
			this.initials = initials;
			return this;
		}
		
		/**
		  * Adds a value to the builder for insurancesAccepted
		  * @param insurancesAccepted Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setInsurancesAccepted(List insurancesAccepted) {
			this.insurancesAccepted = insurancesAccepted;
			return this;
		}
		
		/**
		  * Adds a value to the builder for lastName
		  * @param lastName Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setLastName(String lastName) {
			this.lastName = lastName;
			return this;
		}
		
		/**
		  * Adds a value to the builder for medicalLicenseNumber
		  * @param medicalLicenseNumber Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setMedicalLicenseNumber(String medicalLicenseNumber) {
			this.medicalLicenseNumber = medicalLicenseNumber;
			return this;
		}
		
		/**
		  * Adds a value to the builder for nationalProviderIdentifier
		  * @param nationalProviderIdentifier Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setNationalProviderIdentifier(String nationalProviderIdentifier) {
			this.nationalProviderIdentifier = nationalProviderIdentifier;
			return this;
		}
		
		/**
		  * Adds a value to the builder for office
		  * @param office Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setOffice(String office) {
			this.office = office;
			return this;
		}
		
		/**
		  * Adds a value to the builder for professionalCredential
		  * @param professionalCredential Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setProfessionalCredential(List professionalCredential) {
			this.professionalCredential = professionalCredential;
			return this;
		}
		
		/**
		  * Adds a value to the builder for residency
		  * @param residency Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setResidency(List residency) {
			this.residency = residency;
			return this;
		}
		
		/**
		  * Adds a value to the builder for school
		  * @param school Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setSchool(List school) {
			this.school = school;
			return this;
		}
		
		/**
		  * Adds a value to the builder for specialty
		  * @param specialty Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setSpecialty(List specialty) {
			this.specialty = specialty;
			return this;
		}
		
		/**
		  * Adds a value to the builder for standardizedTitle
		  * @param standardizedTitle Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setStandardizedTitle(String standardizedTitle) {
			this.standardizedTitle = standardizedTitle;
			return this;
		}
		
		/**
		  * Adds a value to the builder for stateLicense
		  * @param stateLicense Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setStateLicense(String stateLicense) {
			this.stateLicense = stateLicense;
			return this;
		}
		
		/**
		  * Adds a value to the builder for isTakingPatients
		  * @param isTakingPatients Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setIsTakingPatients(com.google.protobuf.BoolValue isTakingPatients) {
			this.isTakingPatients = isTakingPatients;
			return this;
		}
		
		/**
		  * Takes the configuration in the mutable Builder and uses it to instantiate a final instance
		  * of the HealthCareProfessionalInformation class
		  * @return The instantiated final HealthCareProfessionalInformation
		 **/
		public HealthCareProfessionalInformation build() {
			return new HealthCareProfessionalInformation(
				this.dateOfBirth,
				this.email,
				this.fellowship,
				this.firstName,
				this.gender,
				this.initials,
				this.insurancesAccepted,
				this.lastName,
				this.medicalLicenseNumber,
				this.nationalProviderIdentifier,
				this.office,
				this.professionalCredential,
				this.residency,
				this.school,
				this.specialty,
				this.standardizedTitle,
				this.stateLicense,
				this.isTakingPatients);
		}
	}

	/**
	 * Returns a Builder for HealthCareProfessionalInformation, which is a mutable representation of the object.  Once the
	 * client has built up an object they can then create an immutable HealthCareProfessionalInformation 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 HealthCareProfessionalInformation instance
	 **/
	 public String toString() {
		 String result = "HealthCareProfessionalInformation\n";
		 result += "-> dateOfBirth: (Date)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.dateOfBirth).split("\n"))) + "\n"; 
		 result += "-> email: (String)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.email).split("\n"))) + "\n"; 
		 result += "-> fellowship: (List)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.fellowship).split("\n"))) + "\n"; 
		 result += "-> firstName: (String)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.firstName).split("\n"))) + "\n"; 
		 result += "-> gender: (HealthCareProfessionalInformation.Gender)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.gender).split("\n"))) + "\n"; 
		 result += "-> initials: (String)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.initials).split("\n"))) + "\n"; 
		 result += "-> insurancesAccepted: (List)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.insurancesAccepted).split("\n"))) + "\n"; 
		 result += "-> lastName: (String)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.lastName).split("\n"))) + "\n"; 
		 result += "-> medicalLicenseNumber: (String)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.medicalLicenseNumber).split("\n"))) + "\n"; 
		 result += "-> nationalProviderIdentifier: (String)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.nationalProviderIdentifier).split("\n"))) + "\n"; 
		 result += "-> office: (String)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.office).split("\n"))) + "\n"; 
		 result += "-> professionalCredential: (List)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.professionalCredential).split("\n"))) + "\n"; 
		 result += "-> residency: (List)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.residency).split("\n"))) + "\n"; 
		 result += "-> school: (List)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.school).split("\n"))) + "\n"; 
		 result += "-> specialty: (List)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.specialty).split("\n"))) + "\n"; 
		 result += "-> standardizedTitle: (String)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.standardizedTitle).split("\n"))) + "\n"; 
		 result += "-> stateLicense: (String)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.stateLicense).split("\n"))) + "\n"; 
		 result += "-> isTakingPatients: (com.google.protobuf.BoolValue)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.isTakingPatients).split("\n"))) + "\n"; 
		 
		 return result;
	 }
	/**
	* Allows for simple conversion between the low-level generated protobuf object to
	* HealthCareProfessionalInformation, which is much more usable.
	* @return An instance of HealthCareProfessionalInformation representing the input proto object
	**/
	public static HealthCareProfessionalInformation fromProto(ApiProto.HealthCareProfessionalInformation proto) {
		HealthCareProfessionalInformation out = null;
		if (proto != null) {
			HealthCareProfessionalInformation.Builder outBuilder = HealthCareProfessionalInformation.newBuilder()
			.setDateOfBirth(proto.hasDateOfBirth()?new Date(proto.getDateOfBirth().getSeconds() * 1000):null)
			.setEmail(proto.getEmail())
			.setFellowship(proto.getFellowshipList())
			.setFirstName(proto.getFirstName())
			.setGender(HealthCareProfessionalInformation.Gender.fromProto(proto.getGender()))
			.setInitials(proto.getInitials())
			.setInsurancesAccepted(proto.getInsurancesAcceptedList())
			.setLastName(proto.getLastName())
			.setMedicalLicenseNumber(proto.getMedicalLicenseNumber())
			.setNationalProviderIdentifier(proto.getNationalProviderIdentifier())
			.setOffice(proto.getOffice())
			.setProfessionalCredential(proto.getProfessionalCredentialList())
			.setResidency(proto.getResidencyList())
			.setSchool(proto.getSchoolList())
			.setSpecialty(proto.getSpecialtyList())
			.setStandardizedTitle(proto.getStandardizedTitle())
			.setStateLicense(proto.getStateLicense())
			.setIsTakingPatients(proto.getIsTakingPatients());
			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 HealthCareProfessionalInformation instances representing the input proto objects
	**/
	public static List fromProtos(List protos) {
		List out = new ArrayList();
		for(ApiProto.HealthCareProfessionalInformation proto : protos) {
			out.add(HealthCareProfessionalInformation.fromProto(proto));
		}
		return out;
	}

	/**
	 * Allows for simple conversion of an object to the low-level generated protobuf object.
	 * @return An instance of ApiProto.HealthCareProfessionalInformation which is a proto object ready for wire transmission
	 **/
	 public ApiProto.HealthCareProfessionalInformation toProto() {
		 HealthCareProfessionalInformation obj = this;
		 ApiProto.HealthCareProfessionalInformation.Builder outBuilder = ApiProto.HealthCareProfessionalInformation.newBuilder();
		 if(obj.getDateOfBirth()!=null){outBuilder.setDateOfBirth(com.google.protobuf.Timestamp.newBuilder().setSeconds(obj.getDateOfBirth().getTime() / 1000).build());}
		 outBuilder.setEmail(obj.getEmail());
		 outBuilder.addAllFellowship(obj.getFellowship());
		 outBuilder.setFirstName(obj.getFirstName());
		 outBuilder.setGender(obj.getGender() != null?obj.getGender().toProto():null);
		 outBuilder.setInitials(obj.getInitials());
		 outBuilder.addAllInsurancesAccepted(obj.getInsurancesAccepted());
		 outBuilder.setLastName(obj.getLastName());
		 outBuilder.setMedicalLicenseNumber(obj.getMedicalLicenseNumber());
		 outBuilder.setNationalProviderIdentifier(obj.getNationalProviderIdentifier());
		 outBuilder.setOffice(obj.getOffice());
		 outBuilder.addAllProfessionalCredential(obj.getProfessionalCredential());
		 outBuilder.addAllResidency(obj.getResidency());
		 outBuilder.addAllSchool(obj.getSchool());
		 outBuilder.addAllSpecialty(obj.getSpecialty());
		 outBuilder.setStandardizedTitle(obj.getStandardizedTitle());
		 outBuilder.setStateLicense(obj.getStateLicense());
		 outBuilder.setIsTakingPatients(obj.getIsTakingPatients()!=null?obj.getIsTakingPatients():null);
		 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.HealthCareProfessionalInformation instances representing the input objects.
	  */
	public static List toProtos(List objects) {
		List out = new ArrayList();
		if(objects != null) {
			for (HealthCareProfessionalInformation obj : objects) {
				out.add(obj!=null?obj.toProto():null);
			}
		}
		return out;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy