View Javadoc
1   package org.kuali.common.jute.project.maven;
2   
3   import static com.google.common.base.Optional.absent;
4   import static org.kuali.common.jute.reflect.Reflection.checkNoNulls;
5   
6   import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
7   import com.google.common.base.Optional;
8   
9   @JsonDeserialize(builder = MavenScm.Builder.class)
10  public final class MavenScm {
11  
12      private final Optional<String> connection;
13      private final Optional<String> developerConnection;
14      private final Optional<String> tag;
15      private final Optional<String> url;
16  
17      private MavenScm(Builder builder) {
18          this.connection = builder.connection;
19          this.developerConnection = builder.developerConnection;
20          this.tag = builder.tag;
21          this.url = builder.url;
22      }
23  
24      public static Builder builder() {
25          return new Builder();
26      }
27  
28      public static class Builder implements org.apache.commons.lang3.builder.Builder<MavenScm> {
29  
30          private Optional<String> connection = absent();
31          private Optional<String> developerConnection = absent();
32          private Optional<String> tag = absent();
33          private Optional<String> url = absent();
34  
35          public Builder withConnection(Optional<String> connection) {
36              this.connection = connection;
37              return this;
38          }
39  
40          public Builder withDeveloperConnection(Optional<String> developerConnection) {
41              this.developerConnection = developerConnection;
42              return this;
43          }
44  
45          public Builder withTag(Optional<String> tag) {
46              this.tag = tag;
47              return this;
48          }
49  
50          public Builder withUrl(Optional<String> url) {
51              this.url = url;
52              return this;
53          }
54  
55          @Override
56          public MavenScm build() {
57              return checkNoNulls(new MavenScm(this));
58          }
59      }
60  
61      public Optional<String> getConnection() {
62          return connection;
63      }
64  
65      public Optional<String> getDeveloperConnection() {
66          return developerConnection;
67      }
68  
69      public Optional<String> getTag() {
70          return tag;
71      }
72  
73      public Optional<String> getUrl() {
74          return url;
75      }
76  
77  }