Package io.modelcontextprotocol.spec
Record Class McpSchema.ProgressNotification
java.lang.Object
java.lang.Record
io.modelcontextprotocol.spec.McpSchema.ProgressNotification
- Record Components:
progressToken- A unique token to identify the progress notification. MUST be unique across all active requests.progress- A value indicating the current progress.total- An optional total amount of work to be done, if known.message- An optional message providing additional context about the progress.meta- See specification for notes on _meta usage
- All Implemented Interfaces:
McpSchema.Notification
- Enclosing class:
- McpSchema
public static record McpSchema.ProgressNotification(String progressToken, Double progress, Double total, String message, Map<String,Object> meta)
extends Record
implements McpSchema.Notification
The Model Context Protocol (MCP) supports optional progress tracking for
long-running operations through notification messages. Either side can send
progress notifications to provide updates about operation status.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.message()Returns the value of themessagerecord component.meta()Returns the value of themetarecord component.progress()Returns the value of theprogressrecord component.Returns the value of theprogressTokenrecord component.final StringtoString()Returns a string representation of this record class.total()Returns the value of thetotalrecord component.
-
Constructor Details
-
ProgressNotification
-
ProgressNotification
public ProgressNotification(String progressToken, Double progress, Double total, String message, Map<String, Object> meta) Creates an instance of aProgressNotificationrecord class.- Parameters:
progressToken- the value for theprogressTokenrecord componentprogress- the value for theprogressrecord componenttotal- the value for thetotalrecord componentmessage- the value for themessagerecord componentmeta- the value for themetarecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. All components in this record class are compared withObjects::equals(Object,Object). -
progressToken
Returns the value of theprogressTokenrecord component.- Returns:
- the value of the
progressTokenrecord component
-
progress
Returns the value of theprogressrecord component.- Returns:
- the value of the
progressrecord component
-
total
Returns the value of thetotalrecord component.- Returns:
- the value of the
totalrecord component
-
message
Returns the value of themessagerecord component.- Returns:
- the value of the
messagerecord component
-
meta
Returns the value of themetarecord component.- Specified by:
metain interfaceMcpSchema.Notification- Returns:
- the value of the
metarecord component
-