View Javadoc
1   /*
2    * Licensed under the Apache License, Version 2.0 (the "License");
3    * you may not use this file except in compliance with the License.
4    * You may obtain a copy of the License at
5    *
6    * http://www.apache.org/licenses/LICENSE-2.0
7    *
8    * Unless required by applicable law or agreed to in writing, software
9    * distributed under the License is distributed on an "AS IS" BASIS,
10   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11   * See the License for the specific language governing permissions and
12   * limitations under the License.
13   */
14  
15  package org.basepom.mojo.propertyhelper.beans;
16  
17  import static com.google.common.base.Preconditions.checkNotNull;
18  
19  import java.util.Optional;
20  
21  import com.google.common.annotations.VisibleForTesting;
22  
23  public class DateDefinition
24          extends AbstractDefinition<DateDefinition> {
25  
26      /**
27       * Timezone for this date. Field injected by Maven.
28       */
29      String timezone = null;
30  
31      /**
32       * Value for this date. Field injected by Maven.
33       */
34      Long value = null;
35  
36      public DateDefinition() {
37      }
38  
39      public Optional<String> getTimezone() {
40          return Optional.ofNullable(timezone);
41      }
42  
43      @VisibleForTesting
44      public DateDefinition setTimezone(final String timezone) {
45          this.timezone = checkNotNull(timezone, "timezone is null");
46          return this;
47      }
48  
49      public Optional<Long> getValue() {
50          return Optional.ofNullable(value);
51      }
52  
53      @VisibleForTesting
54      public DateDefinition setValue(final Long value) {
55          this.value = checkNotNull(value, "value is null");
56          return this;
57      }
58  }