001// Copyright (c) FIRST and other WPILib contributors. 002// Open Source Software; you can modify and/or share it under the terms of 003// the WPILib BSD license file in the root directory of this project. 004 005package edu.wpi.first.wpilibj2.command; 006 007/** 008 * A command that prints a string when initialized. 009 * 010 * <p>This class is provided by the NewCommands VendorDep 011 */ 012public class PrintCommand extends InstantCommand { 013 /** 014 * Creates a new a PrintCommand. 015 * 016 * @param message the message to print 017 */ 018 public PrintCommand(String message) { 019 super(() -> System.out.println(message)); 020 } 021 022 @Override 023 public boolean runsWhenDisabled() { 024 return true; 025 } 026}