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 static org.apache.juneau.commons.utils.CollectionUtils.*;
020import static org.apache.juneau.commons.utils.Shorts.*;
021
022import java.util.*;
023
024import org.apache.juneau.marshall.*;
025
026/**
027 * Result payload for {@value McpMethods#PROMPTS_GET}.
028 */
029@Marshalled
030public class GetPromptResult {
031
032   private String description;
033   private List<PromptMessage> messages;
034
035   /**
036    * Prompt description.
037    *
038    * @return The description, or {@code null} if not set.
039    */
040   public String getDescription() {
041      return description;
042   }
043
044   /**
045    * Sets the prompt description.
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 GetPromptResult setDescription(String value) {
051      description = value;
052      return this;
053   }
054
055   /**
056    * Rendered prompt messages.
057    *
058    * @return The messages list, or {@code null} if not set.
059    */
060   public List<PromptMessage> getMessages() {
061      return u(messages);
062   }
063
064   /**
065    * Sets rendered messages.
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 GetPromptResult setMessages(List<PromptMessage> value) {
071      messages = value;
072      return this;
073   }
074
075   /**
076    * Sets rendered messages.
077    *
078    * @param value The new value.  Can be <jk>null</jk> to unset the property.
079    * @return This object (for method chaining).
080    */
081   public GetPromptResult setMessages(PromptMessage...value) {
082      messages = list(value);
083      return this;
084   }
085
086   /**
087    * Appends to the rendered messages.
088    *
089    * @param value The values to append.
090    * @return This object (for method chaining).
091    */
092   public GetPromptResult addMessages(PromptMessage...value) {
093      if (messages == null)
094         messages = list();
095      Collections.addAll(messages, value);
096      return this;
097   }
098
099   /**
100    * Appends to the rendered messages.
101    *
102    * @param value The values to append.
103    * @return This object (for method chaining).
104    */
105   public GetPromptResult addMessages(Collection<PromptMessage> value) {
106      if (messages == null)
107         messages = list();
108      messages.addAll(value);
109      return this;
110   }
111}