
com.vendasta.sales.v1.internal.ListSalesTeamsResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sales.v1 Show documentation
Show all versions of sales.v1 Show documentation
Java SDK for service sales
The newest version!
package com.vendasta.sales.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 org.apache.commons.lang3.StringUtils;
import com.vendasta.sales.v1.generated.ApiProto;
/**
*
**/
public final class ListSalesTeamsResponse {
private final List salesTeams;
private final PagedResponseMetadata pagingMetadata;
private ListSalesTeamsResponse (
final List salesTeams,
final PagedResponseMetadata pagingMetadata)
{
this.salesTeams = salesTeams;
this.pagingMetadata = pagingMetadata;
}
/**
*
* @return The final value of salesTeams on the object
**/
public List getSalesTeams() {
return this.salesTeams;
}
/**
*
* @return The final value of pagingMetadata on the object
**/
public PagedResponseMetadata getPagingMetadata() {
return this.pagingMetadata;
}
public static class Builder {
private List salesTeams;
private PagedResponseMetadata pagingMetadata;
public Builder() {
this.salesTeams = null;
this.pagingMetadata = null;
}
/**
* Adds a value to the builder for salesTeams
* @param salesTeams Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setSalesTeams(List salesTeams) {
this.salesTeams = salesTeams;
return this;
}
/**
* Adds a value to the builder for pagingMetadata
* @param pagingMetadata Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setPagingMetadata(PagedResponseMetadata pagingMetadata) {
this.pagingMetadata = pagingMetadata;
return this;
}
/**
* Takes the configuration in the mutable Builder and uses it to instantiate a final instance
* of the ListSalesTeamsResponse class
* @return The instantiated final ListSalesTeamsResponse
**/
public ListSalesTeamsResponse build() {
return new ListSalesTeamsResponse(
this.salesTeams,
this.pagingMetadata);
}
}
/**
* Returns a Builder for ListSalesTeamsResponse, which is a mutable representation of the object. Once the
* client has built up an object they can then create an immutable ListSalesTeamsResponse 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 ListSalesTeamsResponse instance
**/
public String toString() {
String result = "ListSalesTeamsResponse\n";
result += "-> salesTeams: (List)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.salesTeams).split("\n"))) + "\n";
result += "-> pagingMetadata: (PagedResponseMetadata)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.pagingMetadata).split("\n"))) + "\n";
return result;
}
/**
* Allows for simple conversion between the low-level generated protobuf object to
* ListSalesTeamsResponse, which is much more usable.
* @return An instance of ListSalesTeamsResponse representing the input proto object
**/
public static ListSalesTeamsResponse fromProto(ApiProto.ListSalesTeamsResponse proto) {
ListSalesTeamsResponse out = null;
if (proto != null) {
ListSalesTeamsResponse.Builder outBuilder = ListSalesTeamsResponse.newBuilder()
.setSalesTeams(SalesTeam.fromProtos(proto.getSalesTeamsList()))
.setPagingMetadata(PagedResponseMetadata.fromProto(proto.getPagingMetadata()));
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 ListSalesTeamsResponse instances representing the input proto objects
**/
public static List fromProtos(List protos) {
List out = new ArrayList();
for(ApiProto.ListSalesTeamsResponse proto : protos) {
out.add(ListSalesTeamsResponse.fromProto(proto));
}
return out;
}
/**
* Allows for simple conversion of an object to the low-level generated protobuf object.
* @return An instance of ApiProto.ListSalesTeamsResponse which is a proto object ready for wire transmission
**/
public ApiProto.ListSalesTeamsResponse toProto() {
ListSalesTeamsResponse obj = this;
ApiProto.ListSalesTeamsResponse.Builder outBuilder = ApiProto.ListSalesTeamsResponse.newBuilder();
outBuilder.addAllSalesTeams(SalesTeam.toProtos(obj.getSalesTeams()));
if(obj.getPagingMetadata() != null){outBuilder.setPagingMetadata(obj.getPagingMetadata().toProto());}
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.ListSalesTeamsResponse instances representing the input objects.
*/
public static List toProtos(List objects) {
List out = new ArrayList();
if(objects != null) {
for (ListSalesTeamsResponse obj : objects) {
out.add(obj!=null?obj.toProto():null);
}
}
return out;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy