Record Class UploadToolUtils.FetchedContent

java.lang.Object
java.lang.Record
io.meeds.mcp.server.tool.util.UploadToolUtils.FetchedContent
Enclosing class:
UploadToolUtils

public static record UploadToolUtils.FetchedContent(byte[] bytes, String mimeType, String fileName) extends Record
A downloaded image: its bytes, resolved mime type and a file name.
  • Constructor Summary

    Constructors
    Constructor
    Description
    FetchedContent(byte[] bytes, String mimeType, String fileName)
    Creates an instance of a FetchedContent record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    Returns the value of the bytes record component.
    boolean
    Compares by content: the bytes are an array.
    Returns the value of the fileName record component.
    int
    Hashes by content, the bytes included.
    Returns the value of the mimeType record component.
    Describes the content by its size, type and name, never its bytes.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • FetchedContent

      public FetchedContent(byte[] bytes, String mimeType, String fileName)
      Creates an instance of a FetchedContent record class.
      Parameters:
      bytes - the value for the bytes record component
      mimeType - the value for the mimeType record component
      fileName - the value for the fileName record component
  • Method Details

    • equals

      public boolean equals(Object o)
      Compares by content: the bytes are an array.
      Specified by:
      equals in class Record
      Parameters:
      o - the other object
      Returns:
      true when the bytes, type and name are equal
    • hashCode

      public int hashCode()
      Hashes by content, the bytes included.
      Specified by:
      hashCode in class Record
      Returns:
      the hash
    • toString

      public String toString()
      Describes the content by its size, type and name, never its bytes.
      Specified by:
      toString in class Record
      Returns:
      the description
    • bytes

      public byte[] bytes()
      Returns the value of the bytes record component.
      Returns:
      the value of the bytes record component
    • mimeType

      public String mimeType()
      Returns the value of the mimeType record component.
      Returns:
      the value of the mimeType record component
    • fileName

      public String fileName()
      Returns the value of the fileName record component.
      Returns:
      the value of the fileName record component