diff options
author | Steve Smokowski <ss835w@att.com> | 2019-04-04 12:58:05 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-04-04 12:58:05 +0000 |
commit | 5f78643c42dd12588a1688f658ca6e134674ea29 (patch) | |
tree | e9ac51142ab3086015831511a7bac6b01ef7786a /bpmn/so-bpmn-infrastructure-common/src/main/java | |
parent | 31788ca37db7e8cf8a8de6417830a5fbffcc0c85 (diff) | |
parent | 53208e180ae8e7f7435bd1768f7c1631c34a0e7b (diff) |
Merge "Implement builder"
Diffstat (limited to 'bpmn/so-bpmn-infrastructure-common/src/main/java')
-rw-r--r-- | bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIServiceInstance.java | 77 |
1 files changed, 66 insertions, 11 deletions
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIServiceInstance.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIServiceInstance.java index 67ba155336..c5cd2c70da 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIServiceInstance.java +++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/aai/AAIServiceInstance.java @@ -29,18 +29,73 @@ public class AAIServiceInstance { String modelVersionId; String environmentContext; String workloadContext; - public AAIServiceInstance(String serviceInstanceName, String serviceType, String serviceRole, - String orchestrationStatus, String modelInvariantUuid, String modelVersionId, String environmentContext, - String workloadContext) { - this.serviceInstanceName = serviceInstanceName; - this.serviceType = serviceType; - this.serviceRole = serviceRole; - this.orchestrationStatus = orchestrationStatus; - this.modelInvariantUuid = modelInvariantUuid; - this.modelVersionId = modelVersionId; - this.environmentContext = environmentContext; - this.workloadContext = workloadContext; + + public static class AAIServiceInstanceBuilder { + private String serviceInstanceName; + private String serviceType; + private String serviceRole; + private String orchestrationStatus; + private String modelInvariantUuid; + private String modelVersionId; + private String environmentContext; + private String workloadContext; + + public AAIServiceInstanceBuilder setServiceInstanceName(String serviceInstanceName) { + this.serviceInstanceName = serviceInstanceName; + return this; + } + + public AAIServiceInstanceBuilder setServiceType(String serviceType) { + this.serviceType = serviceType; + return this; + } + + public AAIServiceInstanceBuilder setServiceRole(String serviceRole) { + this.serviceRole = serviceRole; + return this; + } + + public AAIServiceInstanceBuilder setOrchestrationStatus(String orchestrationStatus) { + this.orchestrationStatus = orchestrationStatus; + return this; + } + + public AAIServiceInstanceBuilder setModelInvariantUuid(String modelInvariantUuid) { + this.modelInvariantUuid = modelInvariantUuid; + return this; + } + + public AAIServiceInstanceBuilder setModelVersionId(String modelVersionId) { + this.modelVersionId = modelVersionId; + return this; + } + + public AAIServiceInstanceBuilder setEnvironmentContext(String environmentContext) { + this.environmentContext = environmentContext; + return this; + } + + public AAIServiceInstanceBuilder setWorkloadContext(String workloadContext) { + this.workloadContext = workloadContext; + return this; + } + + public AAIServiceInstance createAAIServiceInstance() { + return new AAIServiceInstance(this); + } } + + public AAIServiceInstance(AAIServiceInstanceBuilder aaiServiceInstanceBuilder) { + this.serviceInstanceName = aaiServiceInstanceBuilder.serviceInstanceName; + this.serviceType = aaiServiceInstanceBuilder.serviceType; + this.serviceRole = aaiServiceInstanceBuilder.serviceRole; + this.orchestrationStatus = aaiServiceInstanceBuilder.orchestrationStatus; + this.modelInvariantUuid = aaiServiceInstanceBuilder.modelInvariantUuid; + this.modelVersionId = aaiServiceInstanceBuilder.modelVersionId; + this.environmentContext = aaiServiceInstanceBuilder.environmentContext; + this.workloadContext = aaiServiceInstanceBuilder.workloadContext; + } + public String getServiceInstanceName() { return serviceInstanceName; } |