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

org.apache.archiva.redback.rbac.jdo.JdoPermission Maven / Gradle / Ivy

There is a newer version: 2.6.2
Show newest version
// =================== DO NOT EDIT THIS FILE ====================
// Generated by Modello 1.7,
// any modifications will be overwritten.
// ==============================================================

package org.apache.archiva.redback.rbac.jdo;

/**
 * Class JdoPermission.
 * 
 * @version $Revision$ $Date$
 */
public class JdoPermission
    implements org.apache.archiva.redback.rbac.Permission, java.io.Serializable
{

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

    /**
     * Field name.
     */
    private String name;

    /**
     * Field description.
     */
    private String description;

    /**
     * 
     *             true if this object is permanent.
     *           
     */
    private boolean permanent = false;

    /**
     * Field operation.
     */
    private JdoOperation operation;

    /**
     * Field resource.
     */
    private JdoResource resource;


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

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

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

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

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

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

    /**
     * Get the description field.
     * 
     * @return String
     */
    public String getDescription()
    {
        return this.description;
    } //-- String getDescription()

    /**
     * Get the name field.
     * 
     * @return String
     */
    public String getName()
    {
        return this.name;
    } //-- String getName()

    /**
     * Get the operation field.
     * 
     * @return Operation
     */
    public org.apache.archiva.redback.rbac.Operation getOperation()
    {
        return (org.apache.archiva.redback.rbac.Operation) this.operation;
    } //-- org.apache.archiva.redback.rbac.Operation getOperation()

    /**
     * Get the resource field.
     * 
     * @return Resource
     */
    public org.apache.archiva.redback.rbac.Resource getResource()
    {
        return (org.apache.archiva.redback.rbac.Resource) this.resource;
    } //-- org.apache.archiva.redback.rbac.Resource getResource()

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

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

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

    /**
     * Get true if this object is permanent.
     * 
     * @return boolean
     */
    public boolean isPermanent()
    {
        return this.permanent;
    } //-- boolean isPermanent()

    /**
     * Set the description field.
     * 
     * @param description
     */
    public void setDescription( String description )
    {
        this.description = description;
    } //-- void setDescription( String )

    /**
     * Set the name field.
     * 
     * @param name
     */
    public void setName( String name )
    {
        this.name = name;
    } //-- void setName( String )

    /**
     * Set the operation field.
     * 
     * @param operation
     */
    public void setOperation( org.apache.archiva.redback.rbac.Operation operation )
    {
        if ( operation != null && !( operation instanceof JdoOperation ) )
        {
            throw new ClassCastException( "JdoPermission.setOperation( operation ) parameter must be instanceof " + JdoOperation.class.getName() );
        }
        this.operation = (JdoOperation) operation;
    } //-- void setOperation( org.apache.archiva.redback.rbac.Operation )

    /**
     * Set true if this object is permanent.
     * 
     * @param permanent
     */
    public void setPermanent( boolean permanent )
    {
        this.permanent = permanent;
    } //-- void setPermanent( boolean )

    /**
     * Set the resource field.
     * 
     * @param resource
     */
    public void setResource( org.apache.archiva.redback.rbac.Resource resource )
    {
        if ( resource != null && !( resource instanceof JdoResource ) )
        {
            throw new ClassCastException( "JdoPermission.setResource( resource ) parameter must be instanceof " + JdoResource.class.getName() );
        }
        this.resource = (JdoResource) resource;
    } //-- void setResource( org.apache.archiva.redback.rbac.Resource )

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

        buf.append( "name = '" );
        buf.append( getName() );
        buf.append( "'" );

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

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy