All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.maven.doxia.linkcheck.model.LinkcheckModel Maven / Gradle / Ivy

There is a newer version: 1.2
Show newest version
/*
 * $Id$
 */

package org.apache.maven.doxia.linkcheck.model;

  //---------------------------------/
 //- Imported classes and packages -/
//---------------------------------/

import java.util.Date;

/**
 * 
 *          The <linkcheck> element is the root
 * of the linkcheck descriptor.
 *       
 * 
 * @version $Revision$ $Date$
 */
public class LinkcheckModel
    implements java.io.Serializable
{

      //--------------------------/
     //- Class/Member Variables -/
    //--------------------------/

    /**
     * Field files.
     */
    private java.util.List/**/ files;

    /**
     * Field modelEncoding.
     */
    private String modelEncoding = "UTF-8";


      //-----------/
     //- Methods -/
    //-----------/

    /**
     * Method addFile.
     * 
     * @param linkcheckFile
     */
    public void addFile( LinkcheckFile linkcheckFile )
    {
        if ( !(linkcheckFile instanceof LinkcheckFile) )
        {
            throw new ClassCastException( "LinkcheckModel.addFiles(linkcheckFile) parameter must be instanceof " + LinkcheckFile.class.getName() );
        }
        getFiles().add( linkcheckFile );
    } //-- void addFile( LinkcheckFile )

    /**
     * Method equals.
     * 
     * @param other
     * @return boolean
     */
    public boolean equals( Object other )
    {
        if ( this == other )
        {
            return true;
        }

        if ( !( other instanceof LinkcheckModel ) )
        {
            return false;
        }

        LinkcheckModel that = (LinkcheckModel) other;
        boolean result = true;

        result = result && ( getFiles() == null ? that.getFiles() == null : getFiles().equals( that.getFiles() ) );

        return result;
    } //-- boolean equals( Object )

    /**
     * Method getFiles.
     * 
     * @return List
     */
    public java.util.List/**/ getFiles()
    {
        if ( this.files == null )
        {
            this.files = new java.util.ArrayList/**/();
        }

        return this.files;
    } //-- java.util.List/**/ getFiles()

    /**
     * Method getModelEncoding.
     * 
     * @return the current encoding used when reading/writing this
     * model
     */
    public String getModelEncoding()
    {
        return modelEncoding;
    } //-- String getModelEncoding()

    /**
     * Method hashCode.
     * 
     * @return int
     */
    public int hashCode()
    {
        int result = 17;

        result = 37 * result + ( files != null ? files.hashCode() : 0 );

        return result;
    } //-- int hashCode()

    /**
     * Method removeFile.
     * 
     * @param linkcheckFile
     */
    public void removeFile( LinkcheckFile linkcheckFile )
    {
        if ( !(linkcheckFile instanceof LinkcheckFile) )
        {
            throw new ClassCastException( "LinkcheckModel.removeFiles(linkcheckFile) parameter must be instanceof " + LinkcheckFile.class.getName() );
        }
        getFiles().remove( linkcheckFile );
    } //-- void removeFile( LinkcheckFile )

    /**
     * Set 
     *             List of <file> elements.
     *           
     * 
     * @param files
     */
    public void setFiles( java.util.List/**/ files )
    {
        this.files = files;
    } //-- void setFiles( java.util.List )

    /**
     * Set an encoding used for reading/writing the model.
     * 
     * @param modelEncoding
     */
    public void setModelEncoding( String modelEncoding )
    {
        this.modelEncoding = modelEncoding;
    } //-- void setModelEncoding( String )

    /**
     * Method toString.
     * 
     * @return String
     */
    public java.lang.String toString()
    {
        StringBuffer buf = new StringBuffer();

        buf.append( "files = '" );
        buf.append( getFiles() );
        buf.append( "'" );

        return buf.toString();
    } //-- java.lang.String toString()


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy