File Source: WeblogEntryAttribute.java

         /* 
    P/P   *  Method: void pcSetDetachedState(Object)
          * 
          *  Postconditions:
          *    Param_0.pcDetachedState == Param_1
          *    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 org.apache.commons.lang.builder.EqualsBuilder;
    22  import org.apache.commons.lang.builder.HashCodeBuilder;
    23  import org.apache.roller.util.UUIDGenerator;
    24  
    25  
    26  /**
    27   * Weblog entry attribute.
    28   */
    29  public class WeblogEntryAttribute implements Comparable {
    30      
    31      private String id = UUIDGenerator.generateUUID();
    32      private WeblogEntry entry;
    33      private String name;
    34      private String value;
    35      
    36      
             /* 
    P/P       *  Method: void org.apache.roller.weblogger.pojos.WeblogEntryAttribute()
              * 
              *  Postconditions:
              *    init'ed(this.id)
              */
    37      public WeblogEntryAttribute() {
    38      }
    39      
    40      
    41      public String getId() {
                 /* 
    P/P           *  Method: String pcgetId()
                  * 
                  *  Preconditions:
                  *    init'ed(this.id)
                  * 
                  *  Postconditions:
                  *    return_value == this.id
                  *    init'ed(return_value)
                  */
    42          return this.id;
    43      }
    44      
    45      public void setId(String id) {    
                 /* 
    P/P           *  Method: void pcsetId(String)
                  * 
                  *  Postconditions:
                  *    this.id == Param_1
                  *    init'ed(this.id)
                  */
    46          this.id = id;
    47      }
    48      
    49      
    50      public WeblogEntry getEntry() {
                 /* 
    P/P           *  Method: WeblogEntry pcgetEntry()
                  * 
                  *  Preconditions:
                  *    init'ed(this.entry)
                  * 
                  *  Postconditions:
                  *    return_value == this.entry
                  *    init'ed(return_value)
                  */
    51          return entry;
    52      }
    53      
    54      public void setEntry(WeblogEntry entry) {
                 /* 
    P/P           *  Method: void pcsetEntry(WeblogEntry)
                  * 
                  *  Postconditions:
                  *    this.entry == Param_1
                  *    init'ed(this.entry)
                  */
    55          this.entry = entry;
    56      }
    57      
    58      
    59      public String getName() {
                 /* 
    P/P           *  Method: String pcgetName()
                  * 
                  *  Preconditions:
                  *    init'ed(this.name)
                  * 
                  *  Postconditions:
                  *    return_value == this.name
                  *    init'ed(return_value)
                  */
    60          return name;
    61      }
    62      
    63      public void setName(String name) {
                 /* 
    P/P           *  Method: void pcsetName(String)
                  * 
                  *  Postconditions:
                  *    this.name == Param_1
                  *    init'ed(this.name)
                  */
    64          this.name = name;
    65      }
    66      
    67      
    68      public String getValue() {
                 /* 
    P/P           *  Method: String pcgetValue()
                  * 
                  *  Preconditions:
                  *    init'ed(this.value)
                  * 
                  *  Postconditions:
                  *    return_value == this.value
                  *    init'ed(return_value)
                  */
    69          return value;
    70      }
    71      
    72      public void setValue(String value) {
                 /* 
    P/P           *  Method: void pcsetValue(String)
                  * 
                  *  Postconditions:
                  *    this.value == Param_1
                  *    init'ed(this.value)
                  */
    73          this.value = value;
    74      }
    75      
    76      
    77      //------------------------------------------------------- Good citizenship
    78      
    79      public String toString() {
                 /* 
    P/P           *  Method: String toString()
                  * 
                  *  Preconditions:
                  *    init'ed(this.id)
                  *    init'ed(this.name)
                  *    init'ed(this.value)
                  * 
                  *  Postconditions:
                  *    java.lang.StringBuffer:toString(...)._tainted == this.value._tainted | this.id._tainted | this.name._tainted
                  *    init'ed(java.lang.StringBuffer:toString(...)._tainted)
                  *    return_value == &java.lang.StringBuffer:toString(...)
                  */
    80          StringBuffer buf = new StringBuffer();
    81          buf.append("{");
    82          buf.append(this.id);
    83          buf.append(", ").append(this.name);
    84          buf.append(", ").append(this.value);
    85          buf.append("}");
    86          return buf.toString();
    87      }
    88      
    89      public boolean equals(Object other) {
                 /* 
    P/P           *  Method: bool equals(Object)
                  * 
                  *  Preconditions:
                  *    (soft) init'ed(other.entry)
                  *    (soft) init'ed(other.name)
                  *    (soft) init'ed(other.pcStateManager)
                  *    (soft) pcInheritedFieldCount <= 232-3
                  *    (soft) init'ed(this.entry)
                  *    (soft) init'ed(this.name)
                  *    (soft) init'ed(this.pcStateManager)
                  * 
                  *  Presumptions:
                  *    org.apache.commons.lang.builder.EqualsBuilder:append(...)@93 != null
                  * 
                  *  Postconditions:
                  *    init'ed(return_value)
                  * 
                  *  Test Vectors:
                  *    other == this: {0}, {1}
                  */
    90          if (other == this) return true;
    91          if (other instanceof WeblogEntryAttribute != true) return false;
    92          WeblogEntryAttribute o = (WeblogEntryAttribute)other;
    93          return new EqualsBuilder()
    94          .append(getName(), o.getName())
    95          .append(getEntry(), o.getEntry())
    96          .isEquals();
    97      }
    98      
    99      public int hashCode() {
                 /* 
    P/P           *  Method: int hashCode()
                  * 
                  *  Preconditions:
                  *    init'ed(this.entry)
                  *    init'ed(this.name)
                  *    init'ed(this.pcStateManager)
                  *    (soft) pcInheritedFieldCount <= 232-3
                  * 
                  *  Presumptions:
                  *    org.apache.commons.lang.builder.HashCodeBuilder:append(...)@100 != null
                  * 
                  *  Postconditions:
                  *    init'ed(return_value)
                  */
   100          return new HashCodeBuilder()
   101          .append(getName())
   102          .append(getEntry())
   103          .toHashCode();
   104      }
   105      
   106      public int compareTo(Object o) {
                 /* 
    P/P           *  Method: int compareTo(Object)
                  * 
                  *  Preconditions:
                  *    o != null
                  *    init'ed(o.name)
                  *    init'ed(o.pcStateManager)
                  *    this.name != null
                  *    init'ed(this.pcStateManager)
                  *    (soft) pcInheritedFieldCount <= 232-3
                  * 
                  *  Postconditions:
                  *    init'ed(return_value)
                  */
   107          WeblogEntryAttribute att = (WeblogEntryAttribute)o;
   108          return getName().compareTo(att.getName());
   109      }
   110      
   111  }
+  112  Other Messages








SofCheck Inspector Build Version : 2.18479
WeblogEntryAttribute.java 2009-Jan-02 14:25:18
WeblogEntryAttribute.class 2009-Sep-04 03:12:38