Record Class OllamaPullProgress
java.lang.Object
java.lang.Record
uno.anahata.asi.ollama.OllamaPullProgress
- Record Components:
status- the current progress status description (e.g., "pulling manifest", "downloading", "verifying sha256 digest")digest- the sha256 digest of the layer currently being downloadedtotal- the total size in bytes of the current layercompleted- the number of bytes downloaded so farerror- the error message if the pull operation failed
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final longThe field for thecompletedrecord component.private final StringThe field for thedigestrecord component.private final StringThe field for theerrorrecord component.private final StringThe field for thestatusrecord component.private final longThe field for thetotalrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionOllamaPullProgress(String status, String digest, long total, long completed, String error) Creates an instance of aOllamaPullProgressrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of thecompletedrecord component.digest()Returns the value of thedigestrecord component.final booleanIndicates whether some other object is "equal to" this one.error()Returns the value of theerrorrecord component.static OllamaPullProgressfromNode(com.fasterxml.jackson.databind.JsonNode node) Parses an Ollama pull progress event from an SSE JSON chunk.intCalculates the completion percentage for the current layer.final inthashCode()Returns a hash code value for this object.status()Returns the value of thestatusrecord component.final StringtoString()Returns a string representation of this record class.longtotal()Returns the value of thetotalrecord component.
-
Field Details
-
Constructor Details
-
OllamaPullProgress
Creates an instance of aOllamaPullProgressrecord class.
-
-
Method Details
-
getPercent
public int getPercent()Calculates the completion percentage for the current layer.- Returns:
- the percentage from 0 to 100, or -1 if the total byte count is unknown
-
fromNode
Parses an Ollama pull progress event from an SSE JSON chunk.- Parameters:
node- the JSON node received from the stream- Returns:
- a populated
OllamaPullProgressinstance
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
status
-
digest
-
total
-
completed
-
error
-

