diff --git a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/CommandBase.java b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/CommandBase.java index ba2c68f46f..49180a87c3 100644 --- a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/CommandBase.java +++ b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/CommandBase.java @@ -1,5 +1,5 @@ /*----------------------------------------------------------------------------*/ -/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */ +/* Copyright (c) 2018-2020 FIRST. All Rights Reserved. */ /* Open Source Software - may be modified and shared by FRC teams. The code */ /* must be accompanied by the FIRST BSD license file in the root directory of */ /* the project. */ @@ -56,6 +56,18 @@ public abstract class CommandBase implements Sendable, Command { SendableRegistry.setName(this, name); } + /** + * Decorates this Command with a name. + * Is an inline function for #setName(String); + * + * @param name name + * @return the decorated Command + */ + public Command withName(String name) { + this.setName(name); + return this; + } + /** * Gets the subsystem name of this Command. *