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

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




	private final String googleplusUrl;
	private final String linkedinUrl;
	private final String foursquareUrl;
	private final String twitterUrl;
	private final String facebookUrl;
	private final String rssUrl;
	private final String youtubeUrl;
	private final String instagramUrl;
	private final String pinterestUrl;
	

	private SocialURLs (
		final String googleplusUrl,
		final String linkedinUrl,
		final String foursquareUrl,
		final String twitterUrl,
		final String facebookUrl,
		final String rssUrl,
		final String youtubeUrl,
		final String instagramUrl,
		final String pinterestUrl)
		
	{
		this.googleplusUrl = googleplusUrl;
		this.linkedinUrl = linkedinUrl;
		this.foursquareUrl = foursquareUrl;
		this.twitterUrl = twitterUrl;
		this.facebookUrl = facebookUrl;
		this.rssUrl = rssUrl;
		this.youtubeUrl = youtubeUrl;
		this.instagramUrl = instagramUrl;
		this.pinterestUrl = pinterestUrl;
		
	}
	
	/**
	 * 
      * @return The final value of googleplusUrl on the object
	 **/
	public String getGoogleplusUrl() {
		return this.googleplusUrl;
	}
	
	/**
	 * 
      * @return The final value of linkedinUrl on the object
	 **/
	public String getLinkedinUrl() {
		return this.linkedinUrl;
	}
	
	/**
	 * 
      * @return The final value of foursquareUrl on the object
	 **/
	public String getFoursquareUrl() {
		return this.foursquareUrl;
	}
	
	/**
	 * 
      * @return The final value of twitterUrl on the object
	 **/
	public String getTwitterUrl() {
		return this.twitterUrl;
	}
	
	/**
	 * 
      * @return The final value of facebookUrl on the object
	 **/
	public String getFacebookUrl() {
		return this.facebookUrl;
	}
	
	/**
	 * 
      * @return The final value of rssUrl on the object
	 **/
	public String getRssUrl() {
		return this.rssUrl;
	}
	
	/**
	 * 
      * @return The final value of youtubeUrl on the object
	 **/
	public String getYoutubeUrl() {
		return this.youtubeUrl;
	}
	
	/**
	 * 
      * @return The final value of instagramUrl on the object
	 **/
	public String getInstagramUrl() {
		return this.instagramUrl;
	}
	
	/**
	 * 
      * @return The final value of pinterestUrl on the object
	 **/
	public String getPinterestUrl() {
		return this.pinterestUrl;
	}
	

	public static class Builder {
		private String googleplusUrl;
		private String linkedinUrl;
		private String foursquareUrl;
		private String twitterUrl;
		private String facebookUrl;
		private String rssUrl;
		private String youtubeUrl;
		private String instagramUrl;
		private String pinterestUrl;
		
		public Builder() {
			this.googleplusUrl = "";
			this.linkedinUrl = "";
			this.foursquareUrl = "";
			this.twitterUrl = "";
			this.facebookUrl = "";
			this.rssUrl = "";
			this.youtubeUrl = "";
			this.instagramUrl = "";
			this.pinterestUrl = "";
			
		}
		
		/**
		  * Adds a value to the builder for googleplusUrl
		  * @param googleplusUrl Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setGoogleplusUrl(String googleplusUrl) {
			this.googleplusUrl = googleplusUrl;
			return this;
		}
		
		/**
		  * Adds a value to the builder for linkedinUrl
		  * @param linkedinUrl Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setLinkedinUrl(String linkedinUrl) {
			this.linkedinUrl = linkedinUrl;
			return this;
		}
		
		/**
		  * Adds a value to the builder for foursquareUrl
		  * @param foursquareUrl Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setFoursquareUrl(String foursquareUrl) {
			this.foursquareUrl = foursquareUrl;
			return this;
		}
		
		/**
		  * Adds a value to the builder for twitterUrl
		  * @param twitterUrl Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setTwitterUrl(String twitterUrl) {
			this.twitterUrl = twitterUrl;
			return this;
		}
		
		/**
		  * Adds a value to the builder for facebookUrl
		  * @param facebookUrl Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setFacebookUrl(String facebookUrl) {
			this.facebookUrl = facebookUrl;
			return this;
		}
		
		/**
		  * Adds a value to the builder for rssUrl
		  * @param rssUrl Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setRssUrl(String rssUrl) {
			this.rssUrl = rssUrl;
			return this;
		}
		
		/**
		  * Adds a value to the builder for youtubeUrl
		  * @param youtubeUrl Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setYoutubeUrl(String youtubeUrl) {
			this.youtubeUrl = youtubeUrl;
			return this;
		}
		
		/**
		  * Adds a value to the builder for instagramUrl
		  * @param instagramUrl Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setInstagramUrl(String instagramUrl) {
			this.instagramUrl = instagramUrl;
			return this;
		}
		
		/**
		  * Adds a value to the builder for pinterestUrl
		  * @param pinterestUrl Value to assign to the mutable Builder
		  * @return The Builder instance so that call chaining works
		 **/
		public Builder setPinterestUrl(String pinterestUrl) {
			this.pinterestUrl = pinterestUrl;
			return this;
		}
		
		/**
		  * Takes the configuration in the mutable Builder and uses it to instantiate a final instance
		  * of the SocialURLs class
		  * @return The instantiated final SocialURLs
		 **/
		public SocialURLs build() {
			return new SocialURLs(
				this.googleplusUrl,
				this.linkedinUrl,
				this.foursquareUrl,
				this.twitterUrl,
				this.facebookUrl,
				this.rssUrl,
				this.youtubeUrl,
				this.instagramUrl,
				this.pinterestUrl);
		}
	}

	/**
	 * Returns a Builder for SocialURLs, which is a mutable representation of the object.  Once the
	 * client has built up an object they can then create an immutable SocialURLs 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 SocialURLs instance
	 **/
	 public String toString() {
		 String result = "SocialURLs\n";
		 result += "-> googleplusUrl: (String)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.googleplusUrl).split("\n"))) + "\n"; 
		 result += "-> linkedinUrl: (String)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.linkedinUrl).split("\n"))) + "\n"; 
		 result += "-> foursquareUrl: (String)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.foursquareUrl).split("\n"))) + "\n"; 
		 result += "-> twitterUrl: (String)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.twitterUrl).split("\n"))) + "\n"; 
		 result += "-> facebookUrl: (String)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.facebookUrl).split("\n"))) + "\n"; 
		 result += "-> rssUrl: (String)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.rssUrl).split("\n"))) + "\n"; 
		 result += "-> youtubeUrl: (String)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.youtubeUrl).split("\n"))) + "\n"; 
		 result += "-> instagramUrl: (String)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.instagramUrl).split("\n"))) + "\n"; 
		 result += "-> pinterestUrl: (String)"
		     + StringUtils.join("\n  ", Arrays.asList(String.valueOf(this.pinterestUrl).split("\n"))) + "\n"; 
		 
		 return result;
	 }
	/**
	* Allows for simple conversion between the low-level generated protobuf object to
	* SocialURLs, which is much more usable.
	* @return An instance of SocialURLs representing the input proto object
	**/
	public static SocialURLs fromProto(ApiProto.SocialURLs proto) {
		SocialURLs out = null;
		if (proto != null) {
			SocialURLs.Builder outBuilder = SocialURLs.newBuilder()
			.setGoogleplusUrl(proto.getGoogleplusUrl())
			.setLinkedinUrl(proto.getLinkedinUrl())
			.setFoursquareUrl(proto.getFoursquareUrl())
			.setTwitterUrl(proto.getTwitterUrl())
			.setFacebookUrl(proto.getFacebookUrl())
			.setRssUrl(proto.getRssUrl())
			.setYoutubeUrl(proto.getYoutubeUrl())
			.setInstagramUrl(proto.getInstagramUrl())
			.setPinterestUrl(proto.getPinterestUrl());
			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 SocialURLs instances representing the input proto objects
	**/
	public static List fromProtos(List protos) {
		List out = new ArrayList();
		for(ApiProto.SocialURLs proto : protos) {
			out.add(SocialURLs.fromProto(proto));
		}
		return out;
	}

	/**
	 * Allows for simple conversion of an object to the low-level generated protobuf object.
	 * @return An instance of ApiProto.SocialURLs which is a proto object ready for wire transmission
	 **/
	 public ApiProto.SocialURLs toProto() {
		 SocialURLs obj = this;
		 ApiProto.SocialURLs.Builder outBuilder = ApiProto.SocialURLs.newBuilder();
		 outBuilder.setGoogleplusUrl(obj.getGoogleplusUrl());
		 outBuilder.setLinkedinUrl(obj.getLinkedinUrl());
		 outBuilder.setFoursquareUrl(obj.getFoursquareUrl());
		 outBuilder.setTwitterUrl(obj.getTwitterUrl());
		 outBuilder.setFacebookUrl(obj.getFacebookUrl());
		 outBuilder.setRssUrl(obj.getRssUrl());
		 outBuilder.setYoutubeUrl(obj.getYoutubeUrl());
		 outBuilder.setInstagramUrl(obj.getInstagramUrl());
		 outBuilder.setPinterestUrl(obj.getPinterestUrl());
		 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.SocialURLs instances representing the input objects.
	  */
	public static List toProtos(List objects) {
		List out = new ArrayList();
		if(objects != null) {
			for (SocialURLs obj : objects) {
				out.add(obj!=null?obj.toProto():null);
			}
		}
		return out;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy