001package ezvcard.property; 002 003import ezvcard.SupportedVersions; 004import ezvcard.VCardVersion; 005 006/* 007 Copyright (c) 2012-2023, Michael Angstadt 008 All rights reserved. 009 010 Redistribution and use in source and binary forms, with or without 011 modification, are permitted provided that the following conditions are met: 012 013 1. Redistributions of source code must retain the above copyright notice, this 014 list of conditions and the following disclaimer. 015 2. Redistributions in binary form must reproduce the above copyright notice, 016 this list of conditions and the following disclaimer in the documentation 017 and/or other materials provided with the distribution. 018 019 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 020 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 021 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 022 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 023 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 024 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 025 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 026 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 027 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 028 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 029 030 The views and conclusions contained in the software and documentation are those 031 of the authors and should not be interpreted as representing official policies, 032 either expressed or implied, of the FreeBSD Project. 033 */ 034 035/** 036 * <p> 037 * Defines a URI that can be used to retrieve information about the person's 038 * co-workers. 039 * </p> 040 * 041 * <p> 042 * <b>Code sample</b> 043 * </p> 044 * 045 * <pre class="brush:java"> 046 * VCard vcard = new VCard(); 047 * 048 * OrgDirectory orgDirectory = new OrgDirectory("http://www.company.com/staff"); 049 * vcard.addOrgDirectory(orgDirectory); 050 * </pre> 051 * 052 * <p> 053 * <b>Property name:</b> {@code ORG-DIRECTORY} 054 * </p> 055 * <p> 056 * <b>Supported versions:</b> {@code 4.0} 057 * </p> 058 * @author Michael Angstadt 059 * @see <a href="http://tools.ietf.org/html/rfc6715#page-6">RFC 6715 p.6</a> 060 */ 061@SupportedVersions(VCardVersion.V4_0) 062public class OrgDirectory extends UriProperty implements HasAltId { 063 /** 064 * @param uri the URI 065 */ 066 public OrgDirectory(String uri) { 067 super(uri); 068 } 069 070 /** 071 * Copy constructor. 072 * @param original the property to make a copy of 073 */ 074 public OrgDirectory(OrgDirectory original) { 075 super(original); 076 } 077 078 @Override 079 public Integer getIndex() { 080 return super.getIndex(); 081 } 082 083 @Override 084 public void setIndex(Integer index) { 085 super.setIndex(index); 086 } 087 088 /** 089 * Gets the TYPE parameter. 090 * @return the TYPE value (typically, this will be either "work" or "home") 091 * or null if it doesn't exist 092 */ 093 public String getType() { 094 return parameters.getType(); 095 } 096 097 /** 098 * Sets the TYPE parameter. 099 * @param type the TYPE value (this should be either "work" or "home") or 100 * null to remove 101 */ 102 public void setType(String type) { 103 parameters.setType(type); 104 } 105 106 @Override 107 public String getLanguage() { 108 return super.getLanguage(); 109 } 110 111 @Override 112 public void setLanguage(String language) { 113 super.setLanguage(language); 114 } 115 116 @Override 117 public Integer getPref() { 118 return super.getPref(); 119 } 120 121 @Override 122 public void setPref(Integer pref) { 123 super.setPref(pref); 124 } 125 126 //@Override 127 public String getAltId() { 128 return parameters.getAltId(); 129 } 130 131 //@Override 132 public void setAltId(String altId) { 133 parameters.setAltId(altId); 134 } 135 136 @Override 137 public OrgDirectory copy() { 138 return new OrgDirectory(this); 139 } 140}