/*
 * This file is part of adventure, licensed under the MIT License.
 *
 * Copyright (c) 2017-2020 KyoriPowered
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
package net.kyori.adventure.title;

import java.time.Duration;
import net.kyori.adventure.text.Component;
import org.checkerframework.checker.nullness.qual.NonNull;

/**
 * A title.
 */
public interface Title {
  /**
   * Creates a title.
   *
   * @param title the title
   * @param subtitle the subtitle
   * @param fadeInTime the fade-in duration
   * @param stayTime the stay duration
   * @param fadeOutTime the fade-out duration
   * @return the title
   */
  static @NonNull Title of(final @NonNull Component title, final @NonNull Component subtitle, final @NonNull Duration fadeInTime, final @NonNull Duration stayTime, final @NonNull Duration fadeOutTime) {
    return new TitleImpl(title, subtitle, fadeInTime, stayTime, fadeOutTime);
  }

  /**
   * Gets the title.
   *
   * @return the title
   */
  @NonNull Component title();

  /**
   * Gets the subtitle.
   *
   * @return the subtitle
   */
  @NonNull Component subtitle();

  /**
   * Gets the time (in ticks) the title will fade-in.
   *
   * @return the time (in ticks) the title will fade-in
   */
  @NonNull Duration fadeInTime();

  /**
   * Gets the time (in ticks) the title will stay.
   *
   * @return the time (in ticks) the title will stay
   */
  @NonNull Duration stayTime();

  /**
   * Gets the time (in ticks) the title will fade-out.
   *
   * @return the time (in ticks) the title will fade-out
   */
  @NonNull Duration fadeOutTime();
}

@@ -1396,16 +1396,208 @@
 Title %7B%0A
+  /**%0A   * A duration which will preserve a client's existing time for the specific parameter.%0A   *%0A   * %3Cp%3EExact value subject to change.%3C/p%3E%0A   */%0A  Duration KEEP = Duration.ofSeconds(-1);%0A%0A
   /**%0A  
@@ -2127,16 +2127,341 @@
 );%0A  %7D%0A%0A
+  /**%0A   * Creates a title that maintains each client's existing title times.%0A   *%0A   * @param title the title%0A   * @param subtitle the subtitle%0A   * @return the title%0A   */%0A  static @NonNull Title of(final @NonNull Component title, final @NonNull Component subtitle) %7B%0A    return of(title, subtitle, KEEP, KEEP, KEEP);%0A  %7D%0A%0A
   /**%0A  

Allow creating without explicit timings