File Source: WeblogEntryTagWrapper.java
/*
P/P * Method: org.apache.roller.weblogger.pojos.wrapper.WeblogEntryTagWrapper__static_init
*/
1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. The ASF licenses this file to You
4 * under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License. For additional information regarding
15 * copyright in this work, please see the NOTICE file in the top level
16 * directory of this distribution.
17 */
18
19 package org.apache.roller.weblogger.pojos.wrapper;
20
21 import java.sql.Timestamp;
22 import org.apache.roller.weblogger.pojos.WeblogEntryTag;
23
24
25 /**
26 * Pojo safety wrapper for WeblogEntryTag objects.
27 */
28 public class WeblogEntryTagWrapper {
29
30 // keep a reference to the wrapped pojo
31 private final WeblogEntryTag pojo;
32
33
34 // this is private so that we can force the use of the .wrap(pojo) method
/*
P/P * Method: void org.apache.roller.weblogger.pojos.wrapper.WeblogEntryTagWrapper(WeblogEntryTag)
*
* Postconditions:
* this.pojo == toWrap
* init'ed(this.pojo)
*/
35 private WeblogEntryTagWrapper(WeblogEntryTag toWrap) {
36 this.pojo = toWrap;
37 }
38
39
40 // wrap the given pojo if it is not null
41 public static WeblogEntryTagWrapper wrap(WeblogEntryTag toWrap) {
/*
P/P * Method: WeblogEntryTagWrapper wrap(WeblogEntryTag)
*
* Postconditions:
* return_value == One-of{&new WeblogEntryTagWrapper(wrap#1), null}
* return_value in Addr_Set{null,&new WeblogEntryTagWrapper(wrap#1)}
* new WeblogEntryTagWrapper(wrap#1) num objects <= 1
* new WeblogEntryTagWrapper(wrap#1).pojo == toWrap
* new WeblogEntryTagWrapper(wrap#1).pojo != null
*
* Test Vectors:
* toWrap: Addr_Set{null}, Inverse{null}
*/
42 if(toWrap != null)
43 return new WeblogEntryTagWrapper(toWrap);
44
45 return null;
46 }
47
48 // NOTE: removing for 4.0 because it is not necessary
49 // public String getId() {
50 // return this.pojo.getId();
51 // }
52
53 // NOTE: removing for 4.0 because it is not necessary
54 // public WeblogWrapper getWeblog() {
55 // return WeblogWrapper.wrap(this.pojo.getWeblog());
56 // }
57
58 // NOTE: removing for 4.0 because it is not necessary
59 // public WeblogEntryWrapper getWeblogEntry() {
60 // return WeblogEntryWrapper.wrap(this.pojo.getWeblogEntry());
61 // }
62
63
64 public UserWrapper getUser() {
/*
P/P * Method: UserWrapper getUser()
*
* Preconditions:
* this.pojo != null
*
* Postconditions:
* init'ed(return_value)
*/
65 return UserWrapper.wrap(this.pojo.getUser());
66 }
67
68
69 public String getName() {
/*
P/P * Method: String getName()
*
* Preconditions:
* this.pojo != null
*
* Postconditions:
* init'ed(return_value)
*/
70 return this.pojo.getName();
71 }
72
73
74 public Timestamp getTime() {
/*
P/P * Method: Timestamp getTime()
*
* Preconditions:
* this.pojo != null
*
* Postconditions:
* init'ed(return_value)
*/
75 return this.pojo.getTime();
76 }
77
78 }
SofCheck Inspector Build Version : 2.18479
| WeblogEntryTagWrapper.java |
2009-Jan-02 14:25:32 |
| WeblogEntryTagWrapper.class |
2009-Sep-04 03:12:32 |