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.v20260728;
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#RESOURCES_TEMPLATES_LIST}.
028 */
029@Marshalled
030public class ListResourceTemplatesResult extends CacheableResult<ListResourceTemplatesResult> {
031
032   private List<ResourceTemplate> resourceTemplates;
033   private String nextCursor;
034
035   /**
036    * Resource-template descriptors.
037    *
038    * @return The resource templates list, or {@code null} if not set.
039    */
040   public List<ResourceTemplate> getResourceTemplates() {
041      return u(resourceTemplates);
042   }
043
044   /**
045    * Sets the resource-template descriptors.
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 ListResourceTemplatesResult setResourceTemplates(List<ResourceTemplate> value) {
051      resourceTemplates = value;
052      return this;
053   }
054
055   /**
056    * Sets the resource-template descriptors.
057    *
058    * @param value The new value.  Can be <jk>null</jk> to unset the property.
059    * @return This object (for method chaining).
060    */
061   public ListResourceTemplatesResult setResourceTemplates(ResourceTemplate...value) {
062      resourceTemplates = list(value);
063      return this;
064   }
065
066   /**
067    * Appends to the resource-template descriptors.
068    *
069    * @param value The values to append.
070    * @return This object (for method chaining).
071    */
072   public ListResourceTemplatesResult addResourceTemplates(ResourceTemplate...value) {
073      if (resourceTemplates == null)
074         resourceTemplates = list();
075      Collections.addAll(resourceTemplates, value);
076      return this;
077   }
078
079   /**
080    * Appends to the resource-template descriptors.
081    *
082    * @param value The values to append.
083    * @return This object (for method chaining).
084    */
085   public ListResourceTemplatesResult addResourceTemplates(Collection<ResourceTemplate> value) {
086      if (resourceTemplates == null)
087         resourceTemplates = list();
088      resourceTemplates.addAll(value);
089      return this;
090   }
091
092   /**
093    * Pagination cursor for the next page.
094    *
095    * @return The cursor, or {@code null} if not set.
096    */
097   public String getNextCursor() {
098      return nextCursor;
099   }
100
101   /**
102    * Sets the next cursor.
103    *
104    * @param value The new value.  Can be <jk>null</jk> to unset the property.
105    * @return This object (for method chaining).
106    */
107   public ListResourceTemplatesResult setNextCursor(String value) {
108      nextCursor = value;
109      return this;
110   }
111}