Implementation:Treeverse LakeFS Java SDK Model Diff
| Knowledge Sources | |
|---|---|
| Domains | Java_SDK, Data_Model |
| Last Updated | 2026-02-08 00:00 GMT |
Overview
Concrete data transfer object representing a single diff entry between two references in the lakeFS Java SDK.
Description
The Diff class is an auto-generated model object produced by OpenAPI Generator from the lakeFS API specification. It provides type-safe access to diff entry fields through getter/setter methods and supports JSON serialization via Gson. It includes TypeEnum (ADDED, REMOVED, CHANGED, CONFLICT, PREFIX_CHANGED) and PathTypeEnum (COMMON_PREFIX, OBJECT) inner enums.
Usage
Use this model when working with diff results from comparing branches, commits, or references through the lakeFS Java SDK API classes.
Code Reference
Source Location
- Repository: Treeverse_LakeFS
- File: clients/java/src/main/java/io/lakefs/clients/sdk/model/Diff.java
- Lines: 1-517
Signature
public class Diff {
// Fields with @SerializedName annotations
// Getter/setter methods
// equals, hashCode, toString
// JSON type adapter
}
Import
import io.lakefs.clients.sdk.model.Diff;
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| type | TypeEnum | Yes | Type of diff (ADDED, REMOVED, CHANGED, CONFLICT, PREFIX_CHANGED) |
| path | String | Yes | Object path that was changed |
| pathType | PathTypeEnum | Yes | Type of path (COMMON_PREFIX or OBJECT) |
| sizeBytes | Long | No | Size of the object in bytes |
| right | DiffObjectStat | No | Object statistics for the right side of the diff |
Outputs
| Name | Type | Description |
|---|---|---|
| JSON | String | Serialized JSON representation |
Usage Examples
Creating an Instance
import io.lakefs.clients.sdk.model.Diff;
Diff obj = new Diff();
obj.setType(Diff.TypeEnum.ADDED);
obj.setPath("data/new-file.csv");
obj.setPathType(Diff.PathTypeEnum.OBJECT);
obj.setSizeBytes(1024L);