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

org.jboss.resteasy.reactive.common.util.ExtendedCacheControl Maven / Gradle / Ivy

There is a newer version: 3.17.0.CR1
Show newest version
package org.jboss.resteasy.reactive.common.util;

import jakarta.ws.rs.core.CacheControl;

/**
 * Adds support for the public directive which is not supported by {@link CacheControl} for some reason.
 *
 * @author Jozef Hartinger
 *
 * @see RFC-2616 Section 14
 */
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