1. 构建builder 解决参数过多问题
package com.polycom.ngma.core.shared.services;
public class NgmaServiceControlRequest
{
String uuid;
int port;
String serviceTypeName;
String startupCommandTemplate;
String stopCommandTemplate;
String command; // start, stop
public static class Builder {
String uuid;
int port;
String serviceTypeName;
String startupCommandTemplate;
String stopCommandTemplate;
String command; // start, stop
public Builder withUUID(String uuid){
this.uuid=uuid;
return this;
}
public Builder withPort(int port){
this.port=port;
return this;
}
public Builder withServiceTypeName(String serviceTypeName){
this.serviceTypeName=serviceTypeName;
return this;
}