\n\n\n \n
\n
\n
\n001// Generated by delombok at Mon Feb 14 17:40:58 CET 2022\n002/*\n003 * Copyright (c) 2010-2022 Mark Allen, Norbert Bartels.\n004 *\n005 * Permission is hereby granted, free of charge, to any person obtaining a copy\n006 * of this software and associated documentation files (the \"Software\"), to deal\n007 * in the Software without restriction, including without limitation the rights\n008 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n009 * copies of the Software, and to permit persons to whom the Software is\n010 * furnished to do so, subject to the following conditions:\n011 *\n012 * The above copyright notice and this permission notice shall be included in\n013 * all copies or substantial portions of the Software.\n014 *\n015 * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n016 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n017 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n018 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n019 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n020 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n021 * THE SOFTWARE.\n022 */\n023package com.restfb.types.send;\n024\n025import java.util.ArrayList;\n026import java.util.Collections;\n027import java.util.List;\n028import com.restfb.Facebook;\n029import com.restfb.exception.FacebookPreconditionException;\n030import com.restfb.types.AbstractFacebookType;\n031\n032public class ListViewElement extends AbstractFacebookType {\n033 @Facebook\n034 private String title;\n035 @Facebook\n036 private String subtitle;\n037 @Facebook(\"image_url\")\n038 private String imageUrl;\n039 @Facebook(\"default_action\")\n040 private DefaultAction defaultAction;\n041 @Facebook\n042 private List<AbstractButton> buttons;\n043\n044 public ListViewElement(String title) {\n045 this.title = title;\n046 }\n047\n048 public boolean addButton(AbstractButton button) {\n049 if (buttons == null) {\n050 buttons = new ArrayList<>();\n051 }\n052 if (buttons.size() == 1) {\n053 throw new FacebookPreconditionException(\"maximum of associated buttons is 1\");\n054 }\n055 return buttons.add(button);\n056 }\n057\n058 public List<AbstractButton> getButtons() {\n059 if (buttons == null) {\n060 return Collections.emptyList();\n061 }\n062 return Collections.unmodifiableList(buttons);\n063 }\n064\n065 @java.lang.SuppressWarnings(\"all\")\n066 public String getTitle() {\n067 return this.title;\n068 }\n069\n070 @java.lang.SuppressWarnings(\"all\")\n071 public String getSubtitle() {\n072 return this.subtitle;\n073 }\n074\n075 @java.lang.SuppressWarnings(\"all\")\n076 public void setSubtitle(final String subtitle) {\n077 this.subtitle = subtitle;\n078 }\n079\n080 @java.lang.SuppressWarnings(\"all\")\n081 public String getImageUrl() {\n082 return this.imageUrl;\n083 }\n084\n085 @java.lang.SuppressWarnings(\"all\")\n086 public void setImageUrl(final String imageUrl) {\n087 this.imageUrl = imageUrl;\n088 }\n089\n090 @java.lang.SuppressWarnings(\"all\")\n091 public DefaultAction getDefaultAction() {\n092 return this.defaultAction;\n093 }\n094\n095 @java.lang.SuppressWarnings(\"all\")\n096 public void setDefaultAction(final DefaultAction defaultAction) {\n097 this.defaultAction = defaultAction;\n098 }\n099}\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n