Class ProtocolValidator

java.lang.Object
com.betterdiff.core.utils.ProtocolValidator
All Implemented Interfaces:
com.betterdiff.core.protocol.ProtocolVisitor

public class ProtocolValidator
extends java.lang.Object
implements com.betterdiff.core.protocol.ProtocolVisitor
Validates the given protocol.
Author:
troomar
  • Constructor Summary

    Constructors
    Constructor Description
    ProtocolValidator​(com.betterdiff.core.Callback callback)  
  • Method Summary

    Modifier and Type Method Description
    boolean validate​(com.betterdiff.core.protocol.Protocol protocol)
    Validates the given protocol.
    void visit​(com.betterdiff.core.protocol.command.Chunk chunk)  
    void visit​(com.betterdiff.core.protocol.command.Finish finish)  
    void visit​(com.betterdiff.core.protocol.command.Local local)  
    void visit​(com.betterdiff.core.protocol.command.Match match)  
    void visit​(com.betterdiff.core.protocol.command.Move move)  
    void visit​(com.betterdiff.core.protocol.command.Mutation mutation)  
    void visit​(com.betterdiff.core.protocol.command.Pick pick)  
    void visit​(com.betterdiff.core.protocol.command.Row row)  
    void visit​(com.betterdiff.core.protocol.command.Text text)  

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ProtocolValidator

      public ProtocolValidator​(com.betterdiff.core.Callback callback)
  • Method Details

    • validate

      public boolean validate​(com.betterdiff.core.protocol.Protocol protocol)
      Validates the given protocol. Validation is not cached so calling this multiple times will fully validate the protocol, although the protocol can't be changed midtime.
      Returns:
      true if the protocol is valid, else otherwise.
    • visit

      public void visit​(com.betterdiff.core.protocol.command.Chunk chunk)
      Specified by:
      visit in interface com.betterdiff.core.protocol.ProtocolVisitor
    • visit

      public void visit​(com.betterdiff.core.protocol.command.Finish finish)
      Specified by:
      visit in interface com.betterdiff.core.protocol.ProtocolVisitor
    • visit

      public void visit​(com.betterdiff.core.protocol.command.Local local)
      Specified by:
      visit in interface com.betterdiff.core.protocol.ProtocolVisitor
    • visit

      public void visit​(com.betterdiff.core.protocol.command.Match match)
      Specified by:
      visit in interface com.betterdiff.core.protocol.ProtocolVisitor
    • visit

      public void visit​(com.betterdiff.core.protocol.command.Move move)
      Specified by:
      visit in interface com.betterdiff.core.protocol.ProtocolVisitor
    • visit

      public void visit​(com.betterdiff.core.protocol.command.Mutation mutation)
      Specified by:
      visit in interface com.betterdiff.core.protocol.ProtocolVisitor
    • visit

      public void visit​(com.betterdiff.core.protocol.command.Pick pick)
      Specified by:
      visit in interface com.betterdiff.core.protocol.ProtocolVisitor
    • visit

      public void visit​(com.betterdiff.core.protocol.command.Row row)
      Specified by:
      visit in interface com.betterdiff.core.protocol.ProtocolVisitor
    • visit

      public void visit​(com.betterdiff.core.protocol.command.Text text)
      Specified by:
      visit in interface com.betterdiff.core.protocol.ProtocolVisitor