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

com.romansl.url.BaseParam Maven / Gradle / Ivy

Go to download

URL builder based on pure functional principles. No side effects. Immutable. Thread-safe. Easy to use.

The newest version!
package com.romansl.url;

import java.util.ArrayList;

abstract class BaseParam extends URL implements Comparable {
    protected final String mKey;

    protected BaseParam(final URL next, final String key) {
        super(next);

        if (key == null)
            throw new NullPointerException("Key can not be null");

        mKey = key;
    }

    public String getKey() {
        return mKey;
    }

    @Override
    public boolean equals(final Object o) {
        return o == this || o instanceof BaseParam && mKey.equals(((BaseParam) o).mKey);
    }

    @Override
    public int hashCode() {
        return mKey.hashCode();
    }

    abstract boolean equalValues(final BaseParam param2);
    abstract int getValueHashCode();
    abstract void store(final ArrayList out);

    @Override
    public int compareTo(final BaseParam another) {
        return mKey.compareTo(another.mKey);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy