<!DOCTYPE HTML>
<html lang="de">
<head>
<!-- Generated by javadoc (17) -->
<title>Source code</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="source: package: com.restfb.types.send, class: ListViewElement">
<meta name="generator" content="javadoc/SourceToHTMLConverter">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body class="source-page">
<main role="main">
<div class="source-container">
<pre><span class="source-line-no">001</span><span id="line-1">// Generated by delombok at Mon Feb 14 17:40:58 CET 2022</span>
<span class="source-line-no">002</span><span id="line-2">/*</span>
<span class="source-line-no">003</span><span id="line-3"> * Copyright (c) 2010-2022 Mark Allen, Norbert Bartels.</span>
<span class="source-line-no">004</span><span id="line-4"> *</span>
<span class="source-line-no">005</span><span id="line-5"> * Permission is hereby granted, free of charge, to any person obtaining a copy</span>
<span class="source-line-no">006</span><span id="line-6"> * of this software and associated documentation files (the "Software"), to deal</span>
<span class="source-line-no">007</span><span id="line-7"> * in the Software without restriction, including without limitation the rights</span>
<span class="source-line-no">008</span><span id="line-8"> * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell</span>
<span class="source-line-no">009</span><span id="line-9"> * copies of the Software, and to permit persons to whom the Software is</span>
<span class="source-line-no">010</span><span id="line-10"> * furnished to do so, subject to the following conditions:</span>
<span class="source-line-no">011</span><span id="line-11"> *</span>
<span class="source-line-no">012</span><span id="line-12"> * The above copyright notice and this permission notice shall be included in</span>
<span class="source-line-no">013</span><span id="line-13"> * all copies or substantial portions of the Software.</span>
<span class="source-line-no">014</span><span id="line-14"> *</span>
<span class="source-line-no">015</span><span id="line-15"> * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span>
<span class="source-line-no">016</span><span id="line-16"> * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span>
<span class="source-line-no">017</span><span id="line-17"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span>
<span class="source-line-no">018</span><span id="line-18"> * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span>
<span class="source-line-no">019</span><span id="line-19"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span>
<span class="source-line-no">020</span><span id="line-20"> * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN</span>
<span class="source-line-no">021</span><span id="line-21"> * THE SOFTWARE.</span>
<span class="source-line-no">022</span><span id="line-22"> */</span>
<span class="source-line-no">023</span><span id="line-23">package com.restfb.types.send;</span>
<span class="source-line-no">024</span><span id="line-24"></span>
<span class="source-line-no">025</span><span id="line-25">import java.util.ArrayList;</span>
<span class="source-line-no">026</span><span id="line-26">import java.util.Collections;</span>
<span class="source-line-no">027</span><span id="line-27">import java.util.List;</span>
<span class="source-line-no">028</span><span id="line-28">import com.restfb.Facebook;</span>
<span class="source-line-no">029</span><span id="line-29">import com.restfb.exception.FacebookPreconditionException;</span>
<span class="source-line-no">030</span><span id="line-30">import com.restfb.types.AbstractFacebookType;</span>
<span class="source-line-no">031</span><span id="line-31"></span>
<span class="source-line-no">032</span><span id="line-32">public class ListViewElement extends AbstractFacebookType {</span>
<span class="source-line-no">033</span><span id="line-33">  @Facebook</span>
<span class="source-line-no">034</span><span id="line-34">  private String title;</span>
<span class="source-line-no">035</span><span id="line-35">  @Facebook</span>
<span class="source-line-no">036</span><span id="line-36">  private String subtitle;</span>
<span class="source-line-no">037</span><span id="line-37">  @Facebook("image_url")</span>
<span class="source-line-no">038</span><span id="line-38">  private String imageUrl;</span>
<span class="source-line-no">039</span><span id="line-39">  @Facebook("default_action")</span>
<span class="source-line-no">040</span><span id="line-40">  private DefaultAction defaultAction;</span>
<span class="source-line-no">041</span><span id="line-41">  @Facebook</span>
<span class="source-line-no">042</span><span id="line-42">  private List&lt;AbstractButton&gt; buttons;</span>
<span class="source-line-no">043</span><span id="line-43"></span>
<span class="source-line-no">044</span><span id="line-44">  public ListViewElement(String title) {</span>
<span class="source-line-no">045</span><span id="line-45">    this.title = title;</span>
<span class="source-line-no">046</span><span id="line-46">  }</span>
<span class="source-line-no">047</span><span id="line-47"></span>
<span class="source-line-no">048</span><span id="line-48">  public boolean addButton(AbstractButton button) {</span>
<span class="source-line-no">049</span><span id="line-49">    if (buttons == null) {</span>
<span class="source-line-no">050</span><span id="line-50">      buttons = new ArrayList&lt;&gt;();</span>
<span class="source-line-no">051</span><span id="line-51">    }</span>
<span class="source-line-no">052</span><span id="line-52">    if (buttons.size() == 1) {</span>
<span class="source-line-no">053</span><span id="line-53">      throw new FacebookPreconditionException("maximum of associated buttons is 1");</span>
<span class="source-line-no">054</span><span id="line-54">    }</span>
<span class="source-line-no">055</span><span id="line-55">    return buttons.add(button);</span>
<span class="source-line-no">056</span><span id="line-56">  }</span>
<span class="source-line-no">057</span><span id="line-57"></span>
<span class="source-line-no">058</span><span id="line-58">  public List&lt;AbstractButton&gt; getButtons() {</span>
<span class="source-line-no">059</span><span id="line-59">    if (buttons == null) {</span>
<span class="source-line-no">060</span><span id="line-60">      return Collections.emptyList();</span>
<span class="source-line-no">061</span><span id="line-61">    }</span>
<span class="source-line-no">062</span><span id="line-62">    return Collections.unmodifiableList(buttons);</span>
<span class="source-line-no">063</span><span id="line-63">  }</span>
<span class="source-line-no">064</span><span id="line-64"></span>
<span class="source-line-no">065</span><span id="line-65">  @java.lang.SuppressWarnings("all")</span>
<span class="source-line-no">066</span><span id="line-66">  public String getTitle() {</span>
<span class="source-line-no">067</span><span id="line-67">    return this.title;</span>
<span class="source-line-no">068</span><span id="line-68">  }</span>
<span class="source-line-no">069</span><span id="line-69"></span>
<span class="source-line-no