~ubuntu-branches/ubuntu/wily/geronimo-ejb-3.2-spec/wily-proposed

« back to all changes in this revision

Viewing changes to src/main/java/javax/ejb/ScheduleExpression.java

  • Committer: Package Import Robot
  • Author(s): Emmanuel Bourg
  • Date: 2015-07-02 22:35:05 UTC
  • Revision ID: package-import@ubuntu.com-20150702223505-8bzgr9yp8m3bkvyw
Tags: upstream-1.0~alpha-1
ImportĀ upstreamĀ versionĀ 1.0~alpha-1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
 
3
 * contributor license agreements.  See the NOTICE file distributed with
 
4
 * this work for additional information regarding copyright ownership.
 
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
 
6
 * (the "License"); you may not use this file except in compliance with
 
7
 * the License.  You may obtain a copy of the License at
 
8
 *
 
9
 *     http://www.apache.org/licenses/LICENSE-2.0
 
10
 *
 
11
 *  Unless required by applicable law or agreed to in writing, software
 
12
 *  distributed under the License is distributed on an "AS IS" BASIS,
 
13
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
14
 *  See the License for the specific language governing permissions and
 
15
 *  limitations under the License.
 
16
 */
 
17
//
 
18
// This source code implements specifications defined by the Java
 
19
// Community Process. In order to remain compliant with the specification
 
20
// DO NOT add / change / or delete method signatures!
 
21
//
 
22
package javax.ejb;
 
23
 
 
24
import java.io.Serializable;
 
25
import java.util.Date;
 
26
 
 
27
public class ScheduleExpression implements Serializable {
 
28
 
 
29
    private static final long serialVersionUID = -3813254457230997879L;
 
30
    
 
31
        private String dayOfMonth = "*";
 
32
        private String dayOfWeek = "*";
 
33
        private String hour = "0";
 
34
        private String minute = "0";
 
35
        private String month = "*";
 
36
        private String second = "0";
 
37
        private String year = "*";
 
38
        private String timezone;
 
39
        private Date start;
 
40
        private Date end;
 
41
        
 
42
        public ScheduleExpression dayOfMonth(int d) {
 
43
                dayOfMonth = Integer.toString(d);
 
44
                return this;
 
45
        }
 
46
 
 
47
        public ScheduleExpression dayOfMonth(String d) {
 
48
                dayOfMonth = d;
 
49
                return this;
 
50
        }
 
51
 
 
52
        public ScheduleExpression dayOfWeek(int d) {
 
53
                dayOfWeek = Integer.toString(d);
 
54
                return this;
 
55
        }
 
56
 
 
57
        public ScheduleExpression dayOfWeek(String d) {
 
58
                dayOfWeek = d;
 
59
                return this;
 
60
        }
 
61
 
 
62
        public ScheduleExpression end(Date e) {
 
63
                end = e;
 
64
                return this;
 
65
        }
 
66
 
 
67
        public String getDayOfMonth() {
 
68
                return dayOfMonth;
 
69
        }
 
70
 
 
71
        public String getDayOfWeek() {
 
72
                return dayOfWeek;
 
73
        }
 
74
 
 
75
        public Date getEnd() {
 
76
                return end;
 
77
        }
 
78
 
 
79
        public String getHour() {
 
80
                return hour;
 
81
        }
 
82
 
 
83
        public String getMinute() {
 
84
                return minute;
 
85
        }
 
86
 
 
87
        public String getMonth() {
 
88
                return month;
 
89
        }
 
90
 
 
91
        public String getSecond() {
 
92
                return second;
 
93
        }
 
94
 
 
95
        public Date getStart() {
 
96
                return start;
 
97
        }
 
98
 
 
99
        public String getYear() {
 
100
                return year;
 
101
        }
 
102
        
 
103
        public String getTimezone() {
 
104
                return timezone;
 
105
        }
 
106
 
 
107
        public ScheduleExpression hour(int h) {
 
108
                hour = Integer.toString(h);
 
109
                return this;
 
110
        }
 
111
 
 
112
        public ScheduleExpression hour(String h) {
 
113
                hour = h;
 
114
                return this;
 
115
        }
 
116
 
 
117
        public ScheduleExpression minute(int m) {
 
118
                minute = Integer.toString(m);
 
119
                return this;
 
120
        }
 
121
 
 
122
        public ScheduleExpression minute(String m) {
 
123
                minute = m;
 
124
                return this;
 
125
        }
 
126
 
 
127
        public ScheduleExpression month(int m) {
 
128
                month = Integer.toString(m);
 
129
                return this;
 
130
        }
 
131
 
 
132
        public ScheduleExpression month(String m) {
 
133
                month = m;
 
134
                return this;
 
135
        }
 
136
 
 
137
        public ScheduleExpression second(int s) {
 
138
                second = Integer.toString(s);
 
139
                return this;
 
140
        }
 
141
 
 
142
        public ScheduleExpression second(String s) {
 
143
                second = s;
 
144
                return this;
 
145
        }
 
146
 
 
147
        public ScheduleExpression start(Date s) {
 
148
                start = s;
 
149
                return this;
 
150
        }
 
151
 
 
152
        public ScheduleExpression year(int y) {
 
153
                year = Integer.toString(y);
 
154
                return this;
 
155
        }
 
156
 
 
157
        public ScheduleExpression year(String y) {
 
158
                year = y;
 
159
                return this;
 
160
        }
 
161
 
 
162
    /**
 
163
     * See http://en.wikipedia.org/wiki/List_of_zoneinfo_timezones for valid timezones 
 
164
     * @param t
 
165
     * @return
 
166
     */
 
167
        public ScheduleExpression timezone(String t) {
 
168
                timezone = t;
 
169
                return this;
 
170
        }
 
171
}