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

org.jboss.resteasy.core.ExtendedCacheControl Maven / Gradle / Ivy

There is a newer version: 1.1.1
Show newest version
package org.jboss.resteasy.core;

import javax.ws.rs.core.CacheControl;

/**
 * Adds support for the public directive which is not supported by {@link CacheControl} for some reason.
 * 
 * @author Jozef Hartinger
 * 
 * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.1
 */
public class ExtendedCacheControl extends CacheControl {

    private boolean _public = false;
    
    public boolean isPublic() {
        return _public;
    }

    public void setPublic(boolean _public) {
        this._public = _public;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = super.hashCode();
        result = prime * result + (_public ? 1231 : 1237);
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (!super.equals(obj))
            return false;
        if (getClass() != obj.getClass())
            return false;
        ExtendedCacheControl other = (ExtendedCacheControl) obj;
        if (_public != other._public)
            return false;
        return true;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy