Class ReplaceSecurityRequirementCommand
- java.lang.Object
-
- io.apicurio.datamodels.cmd.AbstractCommand
-
- io.apicurio.datamodels.cmd.commands.ReplaceSecurityRequirementCommand
-
- All Implemented Interfaces:
ICommand
public class ReplaceSecurityRequirementCommand extends AbstractCommand
A command used to replace a definition schema with a newer version.- Author:
- eric.wittmann@gmail.com
-
-
Field Summary
Fields Modifier and Type Field Description com.fasterxml.jackson.databind.node.ObjectNode_newRequirementcom.fasterxml.jackson.databind.node.ObjectNode_oldRequirementNodePath_parentPathboolean_replaced
-
Constructor Summary
Constructors Constructor Description ReplaceSecurityRequirementCommand()ReplaceSecurityRequirementCommand(SecurityRequirement old, SecurityRequirement replacement)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanareScopesEqual(List<String> scopes1, List<String> scopes2)voidexecute(Document document)Called to execute the command against the given document.protected intindexOfRequirement(List<SecurityRequirement> requirements, SecurityRequirement requirement)protected booleanisEqual(SecurityRequirement req1, SecurityRequirement req2)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
-
_oldRequirement
public com.fasterxml.jackson.databind.node.ObjectNode _oldRequirement
-
_newRequirement
public com.fasterxml.jackson.databind.node.ObjectNode _newRequirement
-
_replaced
public boolean _replaced
-
-
Constructor Detail
-
ReplaceSecurityRequirementCommand
public ReplaceSecurityRequirementCommand()
-
ReplaceSecurityRequirementCommand
public ReplaceSecurityRequirementCommand(SecurityRequirement old, SecurityRequirement replacement)
-
-
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)
-
indexOfRequirement
protected int indexOfRequirement(List<SecurityRequirement> requirements, SecurityRequirement requirement)
-
isEqual
protected boolean isEqual(SecurityRequirement req1, SecurityRequirement req2)
-
-