Remove proxy docker buildArg
[ccsdk/cds.git] / ms / sdclistener / application / src / main / java / org / onap / ccsdk / cds / sdclistener / util / BuilderUtil.java
1 /*
2  * Copyright (C) 2019 Bell Canada. All rights reserved.
3  *
4  * NOTICE:  All the intellectual and technical concepts contained herein are
5  * proprietary to Bell Canada and are protected by trade secret or copyright law.
6  * Unauthorized copying of this file, via any medium is strictly prohibited.
7  */
8 package org.onap.ccsdk.cds.sdclistener.util;
9
10 import java.util.function.Consumer;
11
12 /**
13  * A generic builder for constructing an object.
14  *
15  * @param <T> - Any object
16  */
17 public class BuilderUtil<T> {
18
19     private final T object;
20
21     public BuilderUtil(T instance) {
22         this.object = instance;
23     }
24
25     public BuilderUtil<T> build(Consumer<T> consumer) {
26         consumer.accept(object);
27         return this;
28     }
29
30     public T create() {
31         return object;
32     }
33 }