//# 0 errors, 147 messages
//#
/*
    //#attachment.java:1:1: class: net.sourceforge.pebble.domain.Attachment
    //#attachment.java:1:1: method: net.sourceforge.pebble.domain.Attachment.net.sourceforge.pebble.domain.Attachment__static_init
 * Copyright (c) 2003-2006, Simon Brown
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *   - Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *
 *   - Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in
 *     the documentation and/or other materials provided with the
 *     distribution.
 *
 *   - Neither the name of Pebble nor the names of its contributors may
 *     be used to endorse or promote products derived from this software
 *     without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */
package net.sourceforge.pebble.domain;


/**
 * Represents a blog entry attachment (such as that used within an RSS
 * enclosure).
 *
 * @author Simon Brown
 */
public class Attachment implements Cloneable {

  /** the URL of the attachment */
  private String url;

  /** the content size (length in bytes) */
  private long size;

  /** the content type */
  private String type;

  /**
   * Default, no args constructor.
   */
  public Attachment() {
    //#attachment.java:55: method: void net.sourceforge.pebble.domain.Attachment.net.sourceforge.pebble.domain.Attachment()
  }
    //#attachment.java:56: end of method: void net.sourceforge.pebble.domain.Attachment.net.sourceforge.pebble.domain.Attachment()

  /**
   * Creates an instance with the specified properties.
   *
   * @param url   a URL as a String
   * @param size    the size in bytes
   * @param type    a content type as a String
   */
  public Attachment(String url, long size, String type) {
    //#attachment.java:65: method: void net.sourceforge.pebble.domain.Attachment.net.sourceforge.pebble.domain.Attachment(String, long, String)
    //#input(void net.sourceforge.pebble.domain.Attachment(String, long, String)): __Descendant_Table[net/sourceforge/pebble/domain/Attachment]
    //#input(void net.sourceforge.pebble.domain.Attachment(String, long, String)): __Descendant_Table[others]
    //#input(void net.sourceforge.pebble.domain.Attachment(String, long, String)): __Dispatch_Table.setSize(J)V
    //#input(void net.sourceforge.pebble.domain.Attachment(String, long, String)): __Dispatch_Table.setType(Ljava/lang/String;)V
    //#input(void net.sourceforge.pebble.domain.Attachment(String, long, String)): __Dispatch_Table.setUrl(Ljava/lang/String;)V
    //#input(void net.sourceforge.pebble.domain.Attachment(String, long, String)): size
    //#input(void net.sourceforge.pebble.domain.Attachment(String, long, String)): this
    //#input(void net.sourceforge.pebble.domain.Attachment(String, long, String)): this.__Tag
    //#input(void net.sourceforge.pebble.domain.Attachment(String, long, String)): type
    //#input(void net.sourceforge.pebble.domain.Attachment(String, long, String)): url
    //#output(void net.sourceforge.pebble.domain.Attachment(String, long, String)): this.size
    //#output(void net.sourceforge.pebble.domain.Attachment(String, long, String)): this.type
    //#output(void net.sourceforge.pebble.domain.Attachment(String, long, String)): this.url
    //#pre[3] (void net.sourceforge.pebble.domain.Attachment(String, long, String)): this.__Tag == net/sourceforge/pebble/domain/Attachment
    //#post(void net.sourceforge.pebble.domain.Attachment(String, long, String)): this.size == size
    //#post(void net.sourceforge.pebble.domain.Attachment(String, long, String)): init'ed(this.size)
    //#post(void net.sourceforge.pebble.domain.Attachment(String, long, String)): this.type == type
    //#post(void net.sourceforge.pebble.domain.Attachment(String, long, String)): init'ed(this.type)
    //#post(void net.sourceforge.pebble.domain.Attachment(String, long, String)): this.url == url
    //#post(void net.sourceforge.pebble.domain.Attachment(String, long, String)): init'ed(this.url)
    setUrl(url);
    setSize(size);
    setType(type);
  }
    //#attachment.java:69: end of method: void net.sourceforge.pebble.domain.Attachment.net.sourceforge.pebble.domain.Attachment(String, long, String)

  /**
   * Gets the URL.
   *
   * @return  the URL as a String
   */
  public String getUrl() {
    return url;
    //#attachment.java:77: method: String net.sourceforge.pebble.domain.Attachment.getUrl()
    //#input(String getUrl()): this
    //#input(String getUrl()): this.url
    //#output(String getUrl()): return_value
    //#pre[2] (String getUrl()): init'ed(this.url)
    //#post(String getUrl()): return_value == this.url
    //#post(String getUrl()): init'ed(return_value)
    //#attachment.java:77: end of method: String net.sourceforge.pebble.domain.Attachment.getUrl()
  }

  /**
   * Sets the URL.
   *
   * @param url   a URL as a String
   */
  public void setUrl(String url) {
    this.url = url;
    //#attachment.java:86: method: void net.sourceforge.pebble.domain.Attachment.setUrl(String)
    //#input(void setUrl(String)): this
    //#input(void setUrl(String)): url
    //#output(void setUrl(String)): this.url
    //#post(void setUrl(String)): this.url == url
    //#post(void setUrl(String)): init'ed(this.url)
  }
    //#attachment.java:87: end of method: void net.sourceforge.pebble.domain.Attachment.setUrl(String)

  /**
   * Gets the size in bytes.
   *
   * @return  the size of the attachement in bytes
   */
  public long getSize() {
    return size;
    //#attachment.java:95: method: long net.sourceforge.pebble.domain.Attachment.getSize()
    //#input(long getSize()): this
    //#input(long getSize()): this.size
    //#output(long getSize()): return_value
    //#pre[2] (long getSize()): init'ed(this.size)
    //#post(long getSize()): return_value == this.size
    //#post(long getSize()): init'ed(return_value)
    //#attachment.java:95: end of method: long net.sourceforge.pebble.domain.Attachment.getSize()
  }

  /**
   * Sets the size of the attachement in bytes.
   *
   * @param size    the size in bytes
   */
  public void setSize(long size) {
    this.size = size;
    //#attachment.java:104: method: void net.sourceforge.pebble.domain.Attachment.setSize(long)
    //#input(void setSize(long)): size
    //#input(void setSize(long)): this
    //#output(void setSize(long)): this.size
    //#post(void setSize(long)): this.size == size
    //#post(void setSize(long)): init'ed(this.size)
  }
    //#attachment.java:105: end of method: void net.sourceforge.pebble.domain.Attachment.setSize(long)

  /**
   * Gets the content type.
   *
   * @return  a MIME type as a String
   */
  public String getType() {
    return type;
    //#attachment.java:113: method: String net.sourceforge.pebble.domain.Attachment.getType()
    //#input(String getType()): this
    //#input(String getType()): this.type
    //#output(String getType()): return_value
    //#pre[2] (String getType()): init'ed(this.type)
    //#post(String getType()): return_value == this.type
    //#post(String getType()): init'ed(return_value)
    //#attachment.java:113: end of method: String net.sourceforge.pebble.domain.Attachment.getType()
  }

  /**
   * Sets the content type.
   *
   * @param type    a content type as a String
   */
  public void setType(String type) {
    this.type = type;
    //#attachment.java:122: method: void net.sourceforge.pebble.domain.Attachment.setType(String)
    //#input(void setType(String)): this
    //#input(void setType(String)): type
    //#output(void setType(String)): this.type
    //#post(void setType(String)): this.type == type
    //#post(void setType(String)): init'ed(this.type)
  }
    //#attachment.java:123: end of method: void net.sourceforge.pebble.domain.Attachment.setType(String)

  public boolean equals(Object o) {
    if (this == o) {
    //#attachment.java:126: method: bool net.sourceforge.pebble.domain.Attachment.equals(Object)
    //#input(bool equals(Object)): __Descendant_Table[net/sourceforge/pebble/domain/Attachment]
    //#input(bool equals(Object)): __Descendant_Table[others]
    //#input(bool equals(Object)): o
    //#input(bool equals(Object)): o.__Tag
    //#input(bool equals(Object)): o.url
    //#input(bool equals(Object)): this
    //#input(bool equals(Object)): this.url
    //#output(bool equals(Object)): return_value
    //#pre[5] (bool equals(Object)): (soft) init'ed(o.url)
    //#pre[8] (bool equals(Object)): (soft) init'ed(this.url)
    //#post(bool equals(Object)): init'ed(return_value)
    //#test_vector(bool equals(Object)): o.url: Addr_Set{null}, Inverse{null}
    //#test_vector(bool equals(Object)): this == o: {0}, {1}
    //#test_vector(bool equals(Object)): this.url: Addr_Set{null}, Inverse{null}
    //#test_vector(bool equals(Object)): java.lang.String:length(...)@135: {1..4_294_967_295}, {0}
    //#test_vector(bool equals(Object)): java.lang.String:length(...)@136: {0}, {1..4_294_967_295}
      return true;
    }

    if (!(o instanceof Attachment)) {
      return false;
    }

    final Attachment attachment = (Attachment) o;
    if (url == null || url.length() == 0) {
      return attachment.url == null || attachment.url.length() == 0;
    } else {
      return url.equals(attachment.url);
    //#attachment.java:138: end of method: bool net.sourceforge.pebble.domain.Attachment.equals(Object)
    }
  }

  public int hashCode() {
    return url.hashCode();
    //#attachment.java:143: method: int net.sourceforge.pebble.domain.Attachment.hashCode()
    //#input(int hashCode()): this
    //#input(int hashCode()): this.url
    //#output(int hashCode()): return_value
    //#pre[2] (int hashCode()): this.url != null
    //#post(int hashCode()): init'ed(return_value)
    //#attachment.java:143: end of method: int net.sourceforge.pebble.domain.Attachment.hashCode()
  }

  /**
   * Creates and returns a copy of this object.
   *
   * @return a clone of this instance.
   * @see Cloneable
   */
  public Object clone() {
    Attachment attachment = new Attachment();
    //#attachment.java:153: method: Object net.sourceforge.pebble.domain.Attachment.clone()
    //#input(Object clone()): __Descendant_Table[net/sourceforge/pebble/domain/Attachment]
    //#input(Object clone()): __Dispatch_Table.setSize(J)V
    //#input(Object clone()): __Dispatch_Table.setType(Ljava/lang/String;)V
    //#input(Object clone()): __Dispatch_Table.setUrl(Ljava/lang/String;)V
    //#input(Object clone()): this
    //#input(Object clone()): this.size
    //#input(Object clone()): this.type
    //#input(Object clone()): this.url
    //#output(Object clone()): new Attachment(clone#1) num objects
    //#output(Object clone()): return_value.__Tag
    //#output(Object clone()): return_value.size
    //#output(Object clone()): return_value.type
    //#output(Object clone()): return_value.url
    //#output(Object clone()): return_value
    //#new obj(Object clone()): new Attachment(clone#1)
    //#pre[2] (Object clone()): init'ed(this.size)
    //#pre[3] (Object clone()): init'ed(this.type)
    //#pre[4] (Object clone()): init'ed(this.url)
    //#post(Object clone()): return_value == &new Attachment(clone#1)
    //#post(Object clone()): new Attachment(clone#1) num objects == 1
    //#post(Object clone()): return_value.__Tag == net/sourceforge/pebble/domain/Attachment
    //#post(Object clone()): return_value.size == this.size
    //#post(Object clone()): init'ed(return_value.size)
    //#post(Object clone()): return_value.type == this.type
    //#post(Object clone()): init'ed(return_value.type)
    //#post(Object clone()): return_value.url == this.url
    //#post(Object clone()): init'ed(return_value.url)
    attachment.setUrl(url);
    attachment.setSize(size);
    attachment.setType(type);

    return attachment;
    //#attachment.java:158: end of method: Object net.sourceforge.pebble.domain.Attachment.clone()
  }

}
    //#output(net.sourceforge.pebble.domain.Attachment__static_init): __Descendant_Table[net/sourceforge/pebble/domain/Attachment]
    //#output(net.sourceforge.pebble.domain.Attachment__static_init): __Dispatch_Table.clone()Ljava/lang/Object;
    //#output(net.sourceforge.pebble.domain.Attachment__static_init): __Dispatch_Table.equals(Ljava/lang/Object;)Z
    //#output(net.sourceforge.pebble.domain.Attachment__static_init): __Dispatch_Table.getSize()J
    //#output(net.sourceforge.pebble.domain.Attachment__static_init): __Dispatch_Table.getType()Ljava/lang/String;
    //#output(net.sourceforge.pebble.domain.Attachment__static_init): __Dispatch_Table.getUrl()Ljava/lang/String;
    //#output(net.sourceforge.pebble.domain.Attachment__static_init): __Dispatch_Table.hashCode()I
    //#output(net.sourceforge.pebble.domain.Attachment__static_init): __Dispatch_Table.setSize(J)V
    //#output(net.sourceforge.pebble.domain.Attachment__static_init): __Dispatch_Table.setType(Ljava/lang/String;)V
    //#output(net.sourceforge.pebble.domain.Attachment__static_init): __Dispatch_Table.setUrl(Ljava/lang/String;)V
    //#post(net.sourceforge.pebble.domain.Attachment__static_init): __Descendant_Table[net/sourceforge/pebble/domain/Attachment] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.domain.Attachment__static_init): __Dispatch_Table.clone()Ljava/lang/Object; == &clone
    //#post(net.sourceforge.pebble.domain.Attachment__static_init): __Dispatch_Table.equals(Ljava/lang/Object;)Z == &equals
    //#post(net.sourceforge.pebble.domain.Attachment__static_init): __Dispatch_Table.getSize()J == &getSize
    //#post(net.sourceforge.pebble.domain.Attachment__static_init): __Dispatch_Table.getType()Ljava/lang/String; == &getType
    //#post(net.sourceforge.pebble.domain.Attachment__static_init): __Dispatch_Table.getUrl()Ljava/lang/String; == &getUrl
    //#post(net.sourceforge.pebble.domain.Attachment__static_init): __Dispatch_Table.hashCode()I == &hashCode
    //#post(net.sourceforge.pebble.domain.Attachment__static_init): __Dispatch_Table.setSize(J)V == &setSize
    //#post(net.sourceforge.pebble.domain.Attachment__static_init): __Dispatch_Table.setType(Ljava/lang/String;)V == &setType
    //#post(net.sourceforge.pebble.domain.Attachment__static_init): __Dispatch_Table.setUrl(Ljava/lang/String;)V == &setUrl
    //#attachment.java:: end of method: net.sourceforge.pebble.domain.Attachment.net.sourceforge.pebble.domain.Attachment__static_init
    //#attachment.java:: end of class: net.sourceforge.pebble.domain.Attachment
