001/* 002 * Licensed under the Apache License, Version 2.0 (the "License"); 003 * you may not use this file except in compliance with the License. 004 * You may obtain a copy of the License at 005 * 006 * http://www.apache.org/licenses/LICENSE-2.0 007 * 008 * Unless required by applicable law or agreed to in writing, software 009 * distributed under the License is distributed on an "AS IS" BASIS, 010 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 011 * See the License for the specific language governing permissions and 012 * limitations under the License. 013 */ 014package org.gbif.ws.util; 015 016import java.util.ArrayList; 017import java.util.List; 018 019import javax.annotation.Nullable; 020 021/** 022 * A simple bean for a http 300 MultipleChoices response listing the available options. 023 * 024 * @see <a href="https://gbif.basecamphq.com/projects/7935093-portal/todo_items/107116544/comments">Basecamp</a> 025 * @see <a href="http://tools.ietf.org/html/rfc2616#page-61">HTTP 1.1 specs</a> 026 */ 027public class MultipleChoices { 028 029 private final List<Choice> choices = new ArrayList<>(); 030 031 public List<Choice> getChoices() { 032 return choices; 033 } 034 035 public void addChoice(Choice choice) { 036 choices.add(choice); 037 } 038 039 public void addChoice( 040 @Nullable Object key, String url, String title, @Nullable String description) { 041 addChoice(new Choice(key, url, title, description)); 042 } 043}