001package biweekly.property;
002
003import biweekly.component.VEvent;
004import biweekly.component.VFreeBusy;
005import biweekly.component.VJournal;
006import biweekly.component.VTodo;
007
008/*
009 Copyright (c) 2013, Michael Angstadt
010 All rights reserved.
011
012 Redistribution and use in source and binary forms, with or without
013 modification, are permitted provided that the following conditions are met: 
014
015 1. Redistributions of source code must retain the above copyright notice, this
016 list of conditions and the following disclaimer. 
017 2. Redistributions in binary form must reproduce the above copyright notice,
018 this list of conditions and the following disclaimer in the documentation
019 and/or other materials provided with the distribution. 
020
021 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
022 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
023 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
024 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
025 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
026 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
027 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
028 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
029 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
030 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
031 */
032
033/**
034 * <p>
035 * This property has different meanings depending on the component it belongs
036 * to:
037 * <ul>
038 * <li>{@link VEvent} - The organizer of the event.</li>
039 * <li>{@link VTodo} - The creator of the to-do task.</li>
040 * <li>{@link VJournal} - The owner of the journal entry.</li>
041 * <li>{@link VFreeBusy} - The person requesting the free/busy time.</li>
042 * </ul>
043 * </p>
044 * <p>
045 * <b>Code sample:</b>
046 * 
047 * <pre class="brush:java">
048 * VEvent event = new VEvent();
049 * 
050 * Organizer organizer = Organizer.email(&quot;johndoe@example.com&quot;);
051 * organizer.setCommonName(&quot;John Doe&quot;);
052 * event.setOrganizer(organizer);
053 * </pre>
054 * 
055 * </p>
056 * @author Michael Angstadt
057 * @see <a href="http://tools.ietf.org/html/rfc5545#page-111">RFC 5545 p.111-2</a>
058 */
059public class Organizer extends TextProperty {
060        /**
061         * Creates an organizer property
062         * @param uri a URI representing the organizer (typically, an email address,
063         * e.g. "mailto:johndoe@example.com")
064         */
065        public Organizer(String uri) {
066                super(uri);
067        }
068
069        /**
070         * Creates an organizer property using an email address as its value.
071         * @param email the email address (e.g. "johndoe@example.com")
072         * @return the property
073         */
074        public static Organizer email(String email) {
075                return new Organizer("mailto:" + email);
076        }
077
078        @Override
079        public String getSentBy() {
080                return super.getSentBy();
081        }
082
083        @Override
084        public void setSentBy(String sentBy) {
085                super.setSentBy(sentBy);
086        }
087
088        @Override
089        public String getCommonName() {
090                return super.getCommonName();
091        }
092
093        @Override
094        public void setCommonName(String commonName) {
095                super.setCommonName(commonName);
096        }
097
098        @Override
099        public String getDirectoryEntry() {
100                return super.getDirectoryEntry();
101        }
102
103        @Override
104        public void setDirectoryEntry(String directoryEntry) {
105                super.setDirectoryEntry(directoryEntry);
106        }
107
108        /**
109         * Gets the language that the common name parameter is written in.
110         */
111        @Override
112        public String getLanguage() {
113                return super.getLanguage();
114        }
115
116        /**
117         * Sets the language that the common name parameter is written in.
118         */
119        @Override
120        public void setLanguage(String language) {
121                super.setLanguage(language);
122        }
123}