001 package ezvcard.parameters;
002
003
004 /*
005 Copyright (c) 2012, Michael Angstadt
006 All rights reserved.
007
008 Redistribution and use in source and binary forms, with or without
009 modification, are permitted provided that the following conditions are met:
010
011 1. Redistributions of source code must retain the above copyright notice, this
012 list of conditions and the following disclaimer.
013 2. Redistributions in binary form must reproduce the above copyright notice,
014 this list of conditions and the following disclaimer in the documentation
015 and/or other materials provided with the distribution.
016
017 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
018 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
019 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
020 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
021 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
022 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
023 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
024 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
025 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
026 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
027
028 The views and conclusions contained in the software and documentation are those
029 of the authors and should not be interpreted as representing official policies,
030 either expressed or implied, of the FreeBSD Project.
031 */
032
033 /**
034 * Represents a CALSCALE parameter.
035 * <p>
036 * vCard versions: 4.0
037 * </p>
038 * @author Michael Angstadt
039 */
040 public class CalscaleParameter extends VCardParameter {
041 public static final String NAME = "CALSCALE";
042
043 public static final CalscaleParameter GREGORIAN = new CalscaleParameter("gregorian");
044
045 /**
046 * Use of this constructor is discouraged and should only be used for
047 * defining non-standard values. Please use one of the predefined static
048 * objects.
049 * @param value the type value (e.g. "gregorian")
050 */
051 public CalscaleParameter(String value) {
052 super(NAME, value);
053 }
054
055 /**
056 * Searches the static objects in this class for one that has a certain type
057 * value.
058 * @param value the type value to search for (e.g. "work")
059 * @return the object or null if not found
060 */
061 public static CalscaleParameter valueOf(String value) {
062 return findByValue(value, CalscaleParameter.class);
063 }
064 }