View Javadoc
1   /*
2    * Copyright 2021 The Netty Project
3    *
4    * The Netty Project licenses this file to you under the Apache License,
5    * version 2.0 (the "License"); you may not use this file except in compliance
6    * with the License. You may obtain a copy of the License at:
7    *
8    *   https://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13   * License for the specific language governing permissions and limitations
14   * under the License.
15   */
16  package io.netty.handler.codec.quic;
17  
18  import java.util.Objects;
19  
20  /**
21   * Configuration used for setup
22   * <a href="https://quiclog.github.io/internet-drafts/draft-marx-qlog-main-schema.html">qlog</a>.
23   */
24  public final class QLogConfiguration {
25  
26      private final String path;
27      private final String logTitle;
28      private final String logDescription;
29  
30      /**
31       * Create a new configuration.
32       *
33       * @param path              the path to the log file to use. This file must not exist yet. If the path is a
34       *                          directory the filename will be generated
35       * @param logTitle          the title to use when logging.
36       * @param logDescription    the description to use when logging.
37       */
38      public QLogConfiguration(String path, String logTitle, String logDescription) {
39          this.path = Objects.requireNonNull(path, "path");
40          this.logTitle = Objects.requireNonNull(logTitle, "logTitle");
41          this.logDescription = Objects.requireNonNull(logDescription, "logDescription");
42      }
43  
44      /**
45       * Return the path to the log file.
46       *
47       * @return the path.
48       */
49      public String path() {
50          return path;
51      }
52  
53      /**
54       * Return the title.
55       *
56       * @return the title.
57       */
58      public String logTitle() {
59          return logTitle;
60      }
61  
62      /**
63       * Return the description.
64       *
65       * @return the description.
66       */
67      public String logDescription() {
68          return logDescription;
69      }
70  }