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

org.codehaus.plexus.redback.rbac.jdo.JdoPermission Maven / Gradle / Ivy

/*
 * $Id$
 */

package org.codehaus.plexus.redback.rbac.jdo;

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

import java.util.Date;

/**
 * null
 * 
 * @version $Revision$ $Date$
 */
public class JdoPermission 
implements org.codehaus.plexus.redback.rbac.Permission, java.io.Serializable
{


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

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

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

    /**
     * Field permanent
     */
    private boolean permanent = false;

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

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


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

    /**
     * Method equals
     * 
     * @param other
     */
    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 null
     */
    public String getDescription()
    {
        return this.description;
    } //-- String getDescription() 

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

    /**
     * Get null
     */
    public org.codehaus.plexus.redback.rbac.Operation getOperation()
    {
        return (org.codehaus.plexus.redback.rbac.Operation) this.operation;
    } //-- org.codehaus.plexus.redback.rbac.Operation getOperation() 

    /**
     * Get null
     */
    public org.codehaus.plexus.redback.rbac.Resource getResource()
    {
        return (org.codehaus.plexus.redback.rbac.Resource) this.resource;
    } //-- org.codehaus.plexus.redback.rbac.Resource getResource() 

    /**
     * Method hashCode
     */
    public int hashCode()
    {
        int result = 17;
        long tmp;
        result = 37 * result + ( name != null ? name.hashCode() : 0 );
        return result;
    } //-- int hashCode() 

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

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

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

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

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

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

    /**
     * Method toString
     */
    public java.lang.String toString()
    {
        StringBuffer buf = new StringBuffer();
        buf.append( "name = '" );
        buf.append( getName() + "'" );
        return buf.toString();
    } //-- java.lang.String toString() 


    private String modelEncoding = "UTF-8";

    public void setModelEncoding( String modelEncoding )
    {
        this.modelEncoding = modelEncoding;
    }

    public String getModelEncoding()
    {
        return modelEncoding;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy