001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.juneau.bean.mcp.v20250618; 018 019import org.apache.juneau.marshall.*; 020 021/** 022 * Text body for {@code resources/read} results or embedded resource content. 023 * 024 * <p> 025 * Discriminator {@code type} value is {@code resourceText} to avoid colliding with {@link TextContent}'s MCP 026 * wire value {@code text} in the same JSON-RPC payload. 027 */ 028@Marshalled(typeName = "resourceText") 029public class TextResourceContents implements ResourceContents { 030 031 private String uri; 032 private String mimeType; 033 private String text; 034 035 /** 036 * Resource URI. 037 * 038 * @return The URI, or {@code null} if not set. 039 */ 040 public String getUri() { 041 return uri; 042 } 043 044 /** 045 * Sets the resource URI. 046 * 047 * @param value The new value. Can be <jk>null</jk> to unset the property. 048 * @return This object (for method chaining). 049 */ 050 public TextResourceContents setUri(String value) { 051 uri = value; 052 return this; 053 } 054 055 /** 056 * Optional MIME type. 057 * 058 * @return The MIME type, or {@code null} if not set. 059 */ 060 public String getMimeType() { 061 return mimeType; 062 } 063 064 /** 065 * Sets the MIME type. 066 * 067 * @param value The new value. Can be <jk>null</jk> to unset the property. 068 * @return This object (for method chaining). 069 */ 070 public TextResourceContents setMimeType(String value) { 071 mimeType = value; 072 return this; 073 } 074 075 /** 076 * UTF-8 text body. 077 * 078 * @return The text, or {@code null} if not set. 079 */ 080 public String getText() { 081 return text; 082 } 083 084 /** 085 * Sets the text body. 086 * 087 * @param value The new value. Can be <jk>null</jk> to unset the property. 088 * @return This object (for method chaining). 089 */ 090 public TextResourceContents setText(String value) { 091 text = value; 092 return this; 093 } 094}