// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.

// THIS FILE WAS AUTO-GENERATED BY ./ntcore/generate_topics.py. DO NOT MODIFY

package org.wpilib.networktables;

import java.util.function.Supplier;

/** NetworkTables generic subscriber. */
public interface GenericSubscriber extends Subscriber, Supplier<NetworkTableValue> {
  /**
   * Get the corresponding topic.
   *
   * @return Topic
   */
  @Override
  Topic getTopic();

  /**
   * Get the last published value.
   * If no value has been published, returns a value with type NetworkTableType.UNASSIGNED.
   *
   * @return value
   */
  NetworkTableValue get();
{% for t in types %}
  /**
   * Gets the entry's value as a {{ t.java.ValueType }}. If the entry does not exist or is of different type, it
   * will return the default value.
   *
   * @param defaultValue the value to be returned if no value is found
   * @return the entry's value or the given default value
   */
  {{ t.java.ValueType }} get{{ t.TypeName }}({{ t.java.ValueType }} defaultValue);
{% if t.java.WrapValueType %}
  /**
   * Gets the entry's value as a boolean array. If the entry does not exist or is of different type,
   * it will return the default value.
   *
   * @param defaultValue the value to be returned if no value is found
   * @return the entry's value or the given default value
   */
  {{ t.java.WrapValueType }} get{{ t.TypeName }}({{ t.java.WrapValueType }} defaultValue);
{% endif -%}
{% endfor %}
  /**
   * Get an array of all value changes since the last call to readQueue.
   * Also provides a timestamp for each value.
   *
   * <p>The "poll storage" subscribe option can be used to set the queue
   * depth.
   *
   * @return Array of timestamped values; empty array if no new changes have
   *     been published since the previous call.
   */
  NetworkTableValue[] readQueue();
}

