Reduce exception guard
[netconf.git] / restconf / restconf-nb-rfc8040 / src / main / java / org / opendaylight / restconf / nb / rfc8040 / StartTimeParam.java
1 /*
2  * Copyright (c) 2021 PANTHEON.tech, s.r.o. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.restconf.nb.rfc8040;
9
10 import org.eclipse.jdt.annotation.NonNull;
11 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
12
13 /**
14  * This class represents a {@code start-time} parameter as defined in
15  * <a href="https://datatracker.ietf.org/doc/html/rfc8040#section-4.8.7">RFC8040 section 4.8.7</a>.
16  */
17 public final class StartTimeParam extends AbstractReplayParam<StartTimeParam> {
18     // API consistency: must not be confused with enum constants
19     @SuppressWarnings("checkstyle:ConstantName")
20     public static final @NonNull String uriName = "start-time";
21
22     private StartTimeParam(final DateAndTime value) {
23         super(value);
24     }
25
26     public static @NonNull StartTimeParam of(final DateAndTime value) {
27         return new StartTimeParam(value);
28     }
29
30     @Override
31     public Class<@NonNull StartTimeParam> javaClass() {
32         return StartTimeParam.class;
33     }
34
35     @Override
36     public String paramName() {
37         return uriName;
38     }
39
40     public static @NonNull StartTimeParam forUriValue(final String uriValue) {
41         return of(new DateAndTime(uriValue));
42     }
43 }