File Source: WeblogBookmarkWrapper.java
/*
P/P * Method: org.apache.roller.weblogger.pojos.wrapper.WeblogBookmarkWrapper__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 org.apache.roller.weblogger.pojos.WeblogBookmark;
22
23
24 /**
25 * Pojo safety wrapper for WeblogBookmark object.
26 */
27 public class WeblogBookmarkWrapper {
28
29 // keep a reference to the wrapped pojo
30 private final WeblogBookmark pojo;
31
32 // 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.WeblogBookmarkWrapper(WeblogBookmark)
*
* Postconditions:
* this.pojo == toWrap
* init'ed(this.pojo)
*/
33 private WeblogBookmarkWrapper(WeblogBookmark toWrap) {
34 this.pojo = toWrap;
35 }
36
37
38 // wrap the given pojo if it is not null
39 public static WeblogBookmarkWrapper wrap(WeblogBookmark toWrap) {
/*
P/P * Method: WeblogBookmarkWrapper wrap(WeblogBookmark)
*
* Postconditions:
* return_value == One-of{&new WeblogBookmarkWrapper(wrap#1), null}
* return_value in Addr_Set{null,&new WeblogBookmarkWrapper(wrap#1)}
* new WeblogBookmarkWrapper(wrap#1) num objects <= 1
* new WeblogBookmarkWrapper(wrap#1).pojo == toWrap
* new WeblogBookmarkWrapper(wrap#1).pojo != null
*
* Test Vectors:
* toWrap: Addr_Set{null}, Inverse{null}
*/
40 if(toWrap != null)
41 return new WeblogBookmarkWrapper(toWrap);
42
43 return null;
44 }
45
46
47 public String getId() {
/*
P/P * Method: String getId()
*
* Preconditions:
* this.pojo != null
*
* Postconditions:
* init'ed(return_value)
*/
48 return this.pojo.getId();
49 }
50
51
52 public String getName() {
/*
P/P * Method: String getName()
*
* Preconditions:
* this.pojo != null
*
* Postconditions:
* init'ed(return_value)
*/
53 return this.pojo.getName();
54 }
55
56
57 public String getDescription() {
/*
P/P * Method: String getDescription()
*
* Preconditions:
* this.pojo != null
*
* Postconditions:
* init'ed(return_value)
*/
58 return this.pojo.getDescription();
59 }
60
61
62 public String getUrl() {
/*
P/P * Method: String getUrl()
*
* Preconditions:
* this.pojo != null
*
* Postconditions:
* init'ed(return_value)
*/
63 return this.pojo.getUrl();
64 }
65
66
67 public Integer getWeight() {
/*
P/P * Method: Integer getWeight()
*
* Preconditions:
* this.pojo != null
*
* Postconditions:
* init'ed(return_value)
*/
68 return this.pojo.getWeight();
69 }
70
71
72 public Integer getPriority() {
/*
P/P * Method: Integer getPriority()
*
* Preconditions:
* this.pojo != null
*
* Postconditions:
* init'ed(return_value)
*/
73 return this.pojo.getPriority();
74 }
75
76
77 public String getImage() {
/*
P/P * Method: String getImage()
*
* Preconditions:
* this.pojo != null
*
* Postconditions:
* init'ed(return_value)
*/
78 return this.pojo.getImage();
79 }
80
81
82 public String getFeedUrl() {
/*
P/P * Method: String getFeedUrl()
*
* Preconditions:
* this.pojo != null
*
* Postconditions:
* init'ed(return_value)
*/
83 return this.pojo.getFeedUrl();
84 }
85
86
87 public WeblogBookmarkFolderWrapper getFolder() {
/*
P/P * Method: WeblogBookmarkFolderWrapper getFolder()
*
* Preconditions:
* this.pojo != null
*
* Postconditions:
* init'ed(return_value)
*/
88 return WeblogBookmarkFolderWrapper.wrap(this.pojo.getFolder());
89 }
90
91 }
SofCheck Inspector Build Version : 2.18479
| WeblogBookmarkWrapper.java |
2009-Jan-02 14:24:46 |
| WeblogBookmarkWrapper.class |
2009-Sep-04 03:12:32 |