src/net/fortuna/ical4j/model/property/TzOffsetTo.java

Tue, 10 Feb 2015 19:58:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 10 Feb 2015 19:58:00 +0100
changeset 4
45d57ecba757
parent 0
fb9019fb1bf7
permissions
-rw-r--r--

Upgrade the upgraded ical4j component to use org.apache.commons.lang3.

michael@3 1 /**
michael@3 2 * Copyright (c) 2012, Ben Fortuna
michael@3 3 * All rights reserved.
michael@3 4 *
michael@3 5 * Redistribution and use in source and binary forms, with or without
michael@3 6 * modification, are permitted provided that the following conditions
michael@3 7 * are met:
michael@3 8 *
michael@3 9 * o Redistributions of source code must retain the above copyright
michael@3 10 * notice, this list of conditions and the following disclaimer.
michael@3 11 *
michael@3 12 * o Redistributions in binary form must reproduce the above copyright
michael@3 13 * notice, this list of conditions and the following disclaimer in the
michael@3 14 * documentation and/or other materials provided with the distribution.
michael@3 15 *
michael@3 16 * o Neither the name of Ben Fortuna nor the names of any other contributors
michael@3 17 * may be used to endorse or promote products derived from this software
michael@3 18 * without specific prior written permission.
michael@3 19 *
michael@3 20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
michael@3 21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
michael@3 22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
michael@3 23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
michael@3 24 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
michael@3 25 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
michael@3 26 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
michael@3 27 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
michael@3 28 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
michael@3 29 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
michael@3 30 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
michael@3 31 */
michael@3 32 package net.fortuna.ical4j.model.property;
michael@3 33
michael@3 34 import net.fortuna.ical4j.model.ParameterList;
michael@3 35 import net.fortuna.ical4j.model.Property;
michael@3 36 import net.fortuna.ical4j.model.PropertyFactoryImpl;
michael@3 37 import net.fortuna.ical4j.model.UtcOffset;
michael@3 38 import net.fortuna.ical4j.model.ValidationException;
michael@3 39
michael@3 40 /**
michael@3 41 * $Id$
michael@3 42 *
michael@3 43 * Created: [Apr 6, 2004]
michael@3 44 *
michael@3 45 * Defines a TZOFFSETTO iCalendar component property.
michael@3 46 * @author benf
michael@3 47 */
michael@3 48 public class TzOffsetTo extends Property {
michael@3 49
michael@3 50 private static final long serialVersionUID = 8213874575051177732L;
michael@3 51
michael@3 52 private UtcOffset offset;
michael@3 53
michael@3 54 /**
michael@3 55 * Default constructor.
michael@3 56 */
michael@3 57 public TzOffsetTo() {
michael@3 58 super(TZOFFSETTO, PropertyFactoryImpl.getInstance());
michael@3 59 }
michael@3 60
michael@3 61 /**
michael@3 62 * @param value an offset value
michael@3 63 */
michael@3 64 public TzOffsetTo(String value) {
michael@3 65 super(TZOFFSETTO, PropertyFactoryImpl.getInstance());
michael@3 66 setValue(value);
michael@3 67 }
michael@3 68
michael@3 69 /**
michael@3 70 * @param aList a list of parameters for this component
michael@3 71 * @param aValue a value string for this component
michael@3 72 */
michael@3 73 public TzOffsetTo(final ParameterList aList, final String aValue) {
michael@3 74 super(TZOFFSETTO, aList, PropertyFactoryImpl.getInstance());
michael@3 75 setValue(aValue);
michael@3 76 }
michael@3 77
michael@3 78 /**
michael@3 79 * @param anOffset a timezone offset in milliseconds
michael@3 80 */
michael@3 81 public TzOffsetTo(final UtcOffset anOffset) {
michael@3 82 super(TZOFFSETTO, PropertyFactoryImpl.getInstance());
michael@3 83 offset = anOffset;
michael@3 84 }
michael@3 85
michael@3 86 /**
michael@3 87 * @param aList a list of parameters for this component
michael@3 88 * @param anOffset a timezone offset in milliseconds
michael@3 89 */
michael@3 90 public TzOffsetTo(final ParameterList aList, final UtcOffset anOffset) {
michael@3 91 super(TZOFFSETTO, aList, PropertyFactoryImpl.getInstance());
michael@3 92 offset = anOffset;
michael@3 93 }
michael@3 94
michael@3 95 /**
michael@3 96 * @return Returns the offset.
michael@3 97 */
michael@3 98 public final UtcOffset getOffset() {
michael@3 99 return offset;
michael@3 100 }
michael@3 101
michael@3 102 /**
michael@3 103 * {@inheritDoc}
michael@3 104 */
michael@3 105 public final void setValue(final String aValue) {
michael@3 106 offset = new UtcOffset(aValue);
michael@3 107 }
michael@3 108
michael@3 109 /**
michael@3 110 * {@inheritDoc}
michael@3 111 */
michael@3 112 public final String getValue() {
michael@3 113 if (offset != null) {
michael@3 114 return offset.toString();
michael@3 115 }
michael@3 116 return "";
michael@3 117 }
michael@3 118
michael@3 119 /**
michael@3 120 * @param offset The offset to set.
michael@3 121 */
michael@3 122 public final void setOffset(final UtcOffset offset) {
michael@3 123 this.offset = offset;
michael@3 124 }
michael@3 125
michael@3 126 /**
michael@3 127 * {@inheritDoc}
michael@3 128 */
michael@3 129 public final void validate() throws ValidationException {
michael@3 130 // TODO: Auto-generated method stub
michael@3 131 }
michael@3 132 }

mercurial