java.lang.Object
edu.university.ecs.lab.delta.models.Delta
All Implemented Interfaces:
JsonSerializable

public class Delta extends Object implements JsonSerializable
This class represents a single Delta change between two commits. In the case of ChangeType.DELETE @see ChangeType the classChange will respectively be null as the instance of this class is no longer locally present for parsing at the new commit
  • Field Details

    • gson

      private static final com.google.gson.Gson gson
    • oldPath

      private String oldPath
      The new path to the file changed/added Note: The path may be null in the event of an add
    • newPath

      private String newPath
      The old path to the file changed/added Note: The path may be null in the event of an delete
    • changeType

      private ChangeType changeType
      The type of change that occurred
    • data

      private com.google.gson.JsonObject data
      The changed contents, could be a changed class or a changed configuration file
  • Constructor Details

    • Delta

      public Delta()
  • Method Details

    • getClassChange

      public JClass getClassChange()
      This method returns an instance of JClass if parsable.
      Returns:
      JClass instance if parsable otherwise null
    • getConfigChange

      public ConfigFile getConfigChange()
      This method returns an instance of ConfigFile if parsable.
      Returns:
      ConfigFile instance if parsable otherwise null
    • toJsonObject

      public com.google.gson.JsonObject toJsonObject()
      Specified by:
      toJsonObject in interface JsonSerializable
      Returns:
      a JsonObject representing this