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 * MCP {@code Implementation} object ({@code BaseMetadata} + {@code Icons} per the schema): required 028 * {@code name} / {@code version}, plus optional {@code title}, {@code description}, and ordered {@code icons}. 029 */ 030@Marshalled 031public class Implementation { 032 033 private String name; 034 private String version; 035 private String title; 036 private String description; 037 private List<Icon> icons; 038 039 /** 040 * Implementation name. 041 * 042 * @return The name, or {@code null} if not set. 043 */ 044 public String getName() { 045 return name; 046 } 047 048 /** 049 * Sets the implementation name. 050 * 051 * @param value The new value. Can be <jk>null</jk> to unset the property. 052 * @return This object (for method chaining). 053 */ 054 public Implementation setName(String value) { 055 name = value; 056 return this; 057 } 058 059 /** 060 * Implementation version. 061 * 062 * @return The version, or {@code null} if not set. 063 */ 064 public String getVersion() { 065 return version; 066 } 067 068 /** 069 * Sets the implementation version. 070 * 071 * @param value The new value. Can be <jk>null</jk> to unset the property. 072 * @return This object (for method chaining). 073 */ 074 public Implementation setVersion(String value) { 075 version = value; 076 return this; 077 } 078 079 /** 080 * Human-readable display title, distinct from the machine-readable {@code name}. 081 * 082 * @return The title, or {@code null} if not set. 083 */ 084 public String getTitle() { 085 return title; 086 } 087 088 /** 089 * Sets the display title. 090 * 091 * @param value The new value. Can be <jk>null</jk> to unset the property. 092 * @return This object (for method chaining). 093 */ 094 public Implementation setTitle(String value) { 095 title = value; 096 return this; 097 } 098 099 /** 100 * Human-readable description. 101 * 102 * @return The description, or {@code null} if not set. 103 */ 104 public String getDescription() { 105 return description; 106 } 107 108 /** 109 * Sets the description. 110 * 111 * @param value The new value. Can be <jk>null</jk> to unset the property. 112 * @return This object (for method chaining). 113 */ 114 public Implementation setDescription(String value) { 115 description = value; 116 return this; 117 } 118 119 /** 120 * Ordered icon descriptors. 121 * 122 * @return The icons list, or {@code null} if not set. 123 */ 124 public List<Icon> getIcons() { 125 return u(icons); 126 } 127 128 /** 129 * Sets the icon descriptors. 130 * 131 * @param value The new value. Can be <jk>null</jk> to unset the property. 132 * @return This object (for method chaining). 133 */ 134 public Implementation setIcons(List<Icon> value) { 135 icons = value; 136 return this; 137 } 138 139 /** 140 * Sets the icon descriptors. 141 * 142 * @param value The new value. Can be <jk>null</jk> to unset the property. 143 * @return This object (for method chaining). 144 */ 145 public Implementation setIcons(Icon...value) { 146 icons = list(value); 147 return this; 148 } 149 150 /** 151 * Appends to the icon descriptors. 152 * 153 * @param value The values to append. 154 * @return This object (for method chaining). 155 */ 156 public Implementation addIcons(Icon...value) { 157 if (icons == null) 158 icons = list(); 159 Collections.addAll(icons, value); 160 return this; 161 } 162 163 /** 164 * Appends to the icon descriptors. 165 * 166 * @param value The values to append. 167 * @return This object (for method chaining). 168 */ 169 public Implementation addIcons(Collection<Icon> value) { 170 if (icons == null) 171 icons = list(); 172 icons.addAll(value); 173 return this; 174 } 175}