Class Delta
java.lang.Object
edu.university.ecs.lab.delta.models.Delta
- All Implemented Interfaces:
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 Summary
Modifier and TypeFieldDescriptionprivate ChangeType
The type of change that occurredprivate com.google.gson.JsonObject
The changed contents, could be a changed class or a changed configuration fileprivate static final com.google.gson.Gson
private String
The old path to the file changed/added Note: The path may be null in the event of an deleteprivate String
The new path to the file changed/added Note: The path may be null in the event of an add -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionThis method returns an instance of JClass if parsable.This method returns an instance of ConfigFile if parsable.com.google.gson.JsonObject
-
Field Details
-
gson
private static final com.google.gson.Gson gson -
oldPath
The new path to the file changed/added Note: The path may be null in the event of an add -
newPath
The old path to the file changed/added Note: The path may be null in the event of an delete -
changeType
The type of change that occurred -
data
private com.google.gson.JsonObject dataThe changed contents, could be a changed class or a changed configuration file
-
-
Constructor Details
-
Delta
public Delta()
-
-
Method Details
-
getClassChange
This method returns an instance of JClass if parsable.- Returns:
- JClass instance if parsable otherwise null
-
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 interfaceJsonSerializable
- Returns:
- a JsonObject representing this
-