RobotCore 1.0
WPILib port to raspberry Pi
Loading...
Searching...
No Matches
UsageReporting.java
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5package org.wpilib.util;
6
7import java.util.function.BiConsumer;
8
10public final class UsageReporting {
11 private static final BiConsumer<String, String> DEFAULT_REPORT_USAGE = (resource, data) -> {};
12 private static volatile BiConsumer<String, String> reportUsageImpl = DEFAULT_REPORT_USAGE;
13
14 private UsageReporting() {}
15
23 public static void reportUsage(String resource, String data) {
24 reportUsageImpl.accept(resource, data);
25 }
26
35 public static void reportUsage(String resource, int instanceNumber, String data) {
36 reportUsage(resource + "[" + instanceNumber + "]", data);
37 }
38
45 public static synchronized void setReportUsageImpl(BiConsumer<String, String> func) {
46 reportUsageImpl = func == null ? DEFAULT_REPORT_USAGE : func;
47 }
48}
static synchronized void setReportUsageImpl(BiConsumer< String, String > func)
static void reportUsage(String resource, String data)
static void reportUsage(String resource, int instanceNumber, String data)