
com.vendasta.accountgroup.v1.internal.OnBoardingStrategy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of accountgroup.v1 Show documentation
Show all versions of accountgroup.v1 Show documentation
Java SDK for service account-group
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;
/**
* Deprecated: use prospect/v1/onboarding_strategies.proto instead
**/
public final class OnBoardingStrategy {
private final String goal;
private final String earlyWins;
private final List priorities;
private OnBoardingStrategy (
final String goal,
final String earlyWins,
final List priorities)
{
this.goal = goal;
this.earlyWins = earlyWins;
this.priorities = priorities;
}
/**
*
* @return The final value of goal on the object
**/
public String getGoal() {
return this.goal;
}
/**
*
* @return The final value of earlyWins on the object
**/
public String getEarlyWins() {
return this.earlyWins;
}
/**
*
* @return The final value of priorities on the object
**/
public List getPriorities() {
return this.priorities;
}
public static class Builder {
private String goal;
private String earlyWins;
private List priorities;
public Builder() {
this.goal = "";
this.earlyWins = "";
this.priorities = new ArrayList();
}
/**
* Adds a value to the builder for goal
* @param goal Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setGoal(String goal) {
this.goal = goal;
return this;
}
/**
* Adds a value to the builder for earlyWins
* @param earlyWins Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setEarlyWins(String earlyWins) {
this.earlyWins = earlyWins;
return this;
}
/**
* Adds a value to the builder for priorities
* @param priorities Value to assign to the mutable Builder
* @return The Builder instance so that call chaining works
**/
public Builder setPriorities(List priorities) {
this.priorities = priorities;
return this;
}
/**
* Takes the configuration in the mutable Builder and uses it to instantiate a final instance
* of the OnBoardingStrategy class
* @return The instantiated final OnBoardingStrategy
**/
public OnBoardingStrategy build() {
return new OnBoardingStrategy(
this.goal,
this.earlyWins,
this.priorities);
}
}
/**
* Returns a Builder for OnBoardingStrategy, which is a mutable representation of the object. Once the
* client has built up an object they can then create an immutable OnBoardingStrategy 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 OnBoardingStrategy instance
**/
public String toString() {
String result = "OnBoardingStrategy\n";
result += "-> goal: (String)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.goal).split("\n"))) + "\n";
result += "-> earlyWins: (String)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.earlyWins).split("\n"))) + "\n";
result += "-> priorities: (List)"
+ StringUtils.join("\n ", Arrays.asList(String.valueOf(this.priorities).split("\n"))) + "\n";
return result;
}
/**
* Allows for simple conversion between the low-level generated protobuf object to
* OnBoardingStrategy, which is much more usable.
* @return An instance of OnBoardingStrategy representing the input proto object
**/
public static OnBoardingStrategy fromProto(ApiProto.OnBoardingStrategy proto) {
OnBoardingStrategy out = null;
if (proto != null) {
OnBoardingStrategy.Builder outBuilder = OnBoardingStrategy.newBuilder()
.setGoal(proto.getGoal())
.setEarlyWins(proto.getEarlyWins())
.setPriorities(proto.getPrioritiesList());
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 OnBoardingStrategy instances representing the input proto objects
**/
public static List fromProtos(List protos) {
List out = new ArrayList();
for(ApiProto.OnBoardingStrategy proto : protos) {
out.add(OnBoardingStrategy.fromProto(proto));
}
return out;
}
/**
* Allows for simple conversion of an object to the low-level generated protobuf object.
* @return An instance of ApiProto.OnBoardingStrategy which is a proto object ready for wire transmission
**/
public ApiProto.OnBoardingStrategy toProto() {
OnBoardingStrategy obj = this;
ApiProto.OnBoardingStrategy.Builder outBuilder = ApiProto.OnBoardingStrategy.newBuilder();
outBuilder.setGoal(obj.getGoal());
outBuilder.setEarlyWins(obj.getEarlyWins());
outBuilder.addAllPriorities(obj.getPriorities());
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.OnBoardingStrategy instances representing the input objects.
*/
public static List toProtos(List objects) {
List out = new ArrayList();
if(objects != null) {
for (OnBoardingStrategy obj : objects) {
out.add(obj!=null?obj.toProto():null);
}
}
return out;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy