File Source: WeblogEntryTagAggregate.java
/*
P/P * Method: void readObject(ObjectInputStream)
*
* Preconditions:
* Param_1 != null
*
* Presumptions:
* init'ed(org.apache.openjpa.enhance.PersistenceCapable.DESERIALIZED)
*
* Postconditions:
* Param_0.pcDetachedState == org.apache.openjpa.enhance.PersistenceCapable.DESERIALIZED
* (soft) init'ed(Param_0.pcDetachedState)
*/
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;
20
21 import java.io.Serializable;
22 import java.sql.Timestamp;
23 import org.apache.commons.lang.builder.EqualsBuilder;
24 import org.apache.commons.lang.builder.HashCodeBuilder;
25 import org.apache.roller.util.UUIDGenerator;
26
27
28 /**
29 * Tag aggregate data.
30 */
31 public class WeblogEntryTagAggregate implements Serializable {
32
33 public static final long serialVersionUID = -4343500268898106982L;
34
35 private String id = UUIDGenerator.generateUUID();
36 private String name = null;
37 private Weblog website = null;
38 private Timestamp lastUsed = null;
39 private int total = 0;
40
41
/*
P/P * Method: void org.apache.roller.weblogger.pojos.WeblogEntryTagAggregate()
*
* Postconditions:
* init'ed(this.id)
* this.lastUsed == null
* this.name == null
* this.website == null
* this.total == 0
*/
42 public WeblogEntryTagAggregate() {
43 }
44
45 public WeblogEntryTagAggregate(String id,
46 Weblog website,
/*
P/P * Method: void org.apache.roller.weblogger.pojos.WeblogEntryTagAggregate(String, Weblog, String, int)
*
* Postconditions:
* init'ed(this.id)
* this.lastUsed == null
* this.name == name
* init'ed(this.name)
* this.total == total
* init'ed(this.total)
* this.website == website
* init'ed(this.website)
*/
47 String name, int total) {
48 //this.id = id;
49 this.website = website;
50 this.name = name;
51 this.total = total;
52 }
53
54 //------------------------------------------------------- Simple properties
55
56 /**
57 * Unique ID and primary key.
58 */
59 public String getId() {
/*
P/P * Method: String pcgetId()
*
* Preconditions:
* init'ed(this.id)
*
* Postconditions:
* return_value == this.id
* init'ed(return_value)
*/
60 return this.id;
61 }
62
63 public void setId(String id) {
/*
P/P * Method: void pcsetId(String)
*
* Postconditions:
* this.id == Param_1
* init'ed(this.id)
*/
64 this.id = id;
65 }
66
67
68 public Weblog getWeblog() {
/*
P/P * Method: Weblog pcgetWeblog()
*
* Preconditions:
* init'ed(this.website)
*
* Postconditions:
* return_value == this.website
* init'ed(return_value)
*/
69 return this.website;
70 }
71
72 public void setWeblog(Weblog website) {
/*
P/P * Method: void pcsetWeblog(Weblog)
*
* Postconditions:
* this.website == Param_1
* init'ed(this.website)
*/
73 this.website = website;
74 }
75
76
77 /**
78 * Tag value.
79 */
80 public String getName() {
/*
P/P * Method: String pcgetName()
*
* Preconditions:
* init'ed(this.name)
*
* Postconditions:
* return_value == this.name
* init'ed(return_value)
*/
81 return this.name;
82 }
83
84 public void setName( String name ) {
/*
P/P * Method: void pcsetName(String)
*
* Postconditions:
* this.name == Param_1
* init'ed(this.name)
*/
85 this.name = name;
86 }
87
88
89 public int getTotal() {
/*
P/P * Method: int pcgetTotal()
*
* Preconditions:
* init'ed(this.total)
*
* Postconditions:
* return_value == this.total
* init'ed(return_value)
*/
90 return this.total;
91 }
92
93 public void setTotal(int total) {
/*
P/P * Method: void pcsetTotal(int)
*
* Postconditions:
* this.total == Param_1
* init'ed(this.total)
*/
94 this.total = total;
95 }
96
97
98 public Timestamp getLastUsed() {
/*
P/P * Method: Timestamp pcgetLastUsed()
*
* Preconditions:
* init'ed(this.lastUsed)
*
* Postconditions:
* return_value == this.lastUsed
* init'ed(return_value)
*/
99 return this.lastUsed;
100 }
101
102 public void setLastUsed(Timestamp lastUsed) {
/*
P/P * Method: void pcsetLastUsed(Timestamp)
*
* Postconditions:
* this.lastUsed == Param_1
* init'ed(this.lastUsed)
*/
103 this.lastUsed = lastUsed;
104 }
105
106 //------------------------------------------------------- Good citizenship
107
108 public String toString() {
/*
P/P * Method: String toString()
*
* Preconditions:
* init'ed(this.id)
* init'ed(this.lastUsed)
* init'ed(this.name)
* init'ed(this.total)
*
* Postconditions:
* java.lang.StringBuffer:toString(...)._tainted == this.id._tainted | this.name._tainted
* init'ed(java.lang.StringBuffer:toString(...)._tainted)
* return_value == &java.lang.StringBuffer:toString(...)
*/
109 StringBuffer buf = new StringBuffer();
110 buf.append("{");
111 buf.append(this.id);
112 buf.append(", ").append(this.name);
113 buf.append(", ").append(this.total);
114 buf.append(", ").append(this.lastUsed);
115 buf.append("}");
116 return buf.toString();
117 }
118
119 public boolean equals(Object other) {
/*
P/P * Method: bool equals(Object)
*
* Preconditions:
* (soft) init'ed(other.name)
* (soft) init'ed(other.pcStateManager)
* (soft) init'ed(other.website)
* (soft) pcInheritedFieldCount <= 232-5
* (soft) init'ed(this.name)
* (soft) init'ed(this.pcStateManager)
* (soft) init'ed(this.website)
*
* Presumptions:
* org.apache.commons.lang.builder.EqualsBuilder:append(...)@123 != null
*
* Postconditions:
* init'ed(return_value)
*
* Test Vectors:
* other == this: {0}, {1}
*/
120 if (other == this) return true;
121 if (other instanceof WeblogEntryTagAggregate != true) return false;
122 WeblogEntryTagAggregate o = (WeblogEntryTagAggregate)other;
123 return new EqualsBuilder()
124 .append(getName(), o.getName())
125 .append(this.getWeblog(), o.getWeblog())
126 .isEquals();
127 }
128
129 public int hashCode() {
/*
P/P * Method: int hashCode()
*
* Preconditions:
* init'ed(this.name)
* init'ed(this.pcStateManager)
* init'ed(this.website)
* (soft) pcInheritedFieldCount <= 232-5
*
* Presumptions:
* org.apache.commons.lang.builder.HashCodeBuilder:append(...)@130 != null
*
* Postconditions:
* init'ed(return_value)
*/
130 return new HashCodeBuilder()
131 .append(getName())
132 .append(getWeblog())
133 .toHashCode();
134 }
135
136 }
+ 137 Other Messages
SofCheck Inspector Build Version : 2.18479
| WeblogEntryTagAggregate.java |
2009-Jan-02 14:24:58 |
| WeblogEntryTagAggregate.class |
2009-Sep-04 03:12:38 |