Class AddExampleCommand
- java.lang.Object
-
- io.apicurio.datamodels.cmd.AbstractCommand
-
- io.apicurio.datamodels.cmd.commands.AddExampleCommand
-
- All Implemented Interfaces:
ICommand
public class AddExampleCommand extends AbstractCommand
A command used to add an Example to a MediaType, Parameter, or Header. If an example with the same name already exists, this command does nothing.- Author:
- eric.wittmann@gmail.com
-
-
Field Summary
Fields Modifier and Type Field Description boolean_exampleAddedString_newExampleDescriptionString_newExampleNameString_newExampleSummarycom.fasterxml.jackson.databind.JsonNode_newExampleValueNodePath_parentPath
-
Constructor Summary
Constructors Constructor Description AddExampleCommand()AddExampleCommand(OpenApiExamplesParent parent, com.fasterxml.jackson.databind.JsonNode example, String exampleName, String exampleSummary, String exampleDescription)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute(Document document)Called to execute the command against the given document.voidundo(Document document)Called to undo the command (restore the document to a previous state).-
Methods inherited from class io.apicurio.datamodels.cmd.AbstractCommand
indexOf, isNullOrUndefined, type
-
-
-
-
Field Detail
-
_parentPath
public NodePath _parentPath
-
_newExampleValue
public com.fasterxml.jackson.databind.JsonNode _newExampleValue
-
_newExampleName
public String _newExampleName
-
_newExampleSummary
public String _newExampleSummary
-
_newExampleDescription
public String _newExampleDescription
-
_exampleAdded
public boolean _exampleAdded
-
-
Constructor Detail
-
AddExampleCommand
public AddExampleCommand()
-
AddExampleCommand
public AddExampleCommand(OpenApiExamplesParent parent, com.fasterxml.jackson.databind.JsonNode example, String exampleName, String exampleSummary, String exampleDescription)
-
-
Method Detail
-
execute
public void execute(Document document)
Description copied from interface:ICommandCalled to execute the command against the given document.- See Also:
ICommand.execute(Document)
-
undo
public void undo(Document document)
Description copied from interface:ICommandCalled to undo the command (restore the document to a previous state).- See Also:
ICommand.undo(Document)
-
-