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

com.clianz.spur.helpers.Endpoint Maven / Gradle / Ivy

The newest version!
package com.clianz.spur.helpers;

import java.util.Objects;
import java.util.function.BiConsumer;

import com.clianz.spur.Req;
import com.clianz.spur.Res;

import io.undertow.util.HttpString;

public class Endpoint {

    private String path;
    private HttpString method;
    private BiConsumer reqResBiConsumer;
    private Class bodyClassType;

    public Endpoint(HttpString method, String path, BiConsumer reqResBiConsumer, Class bodyClassType) {
        this.method = method;
        this.path = path;
        this.reqResBiConsumer = reqResBiConsumer;
        this.bodyClassType = bodyClassType;
    }

    public String getPath() {
        return path;
    }

    public HttpString getMethod() {
        return method;
    }

    public BiConsumer getReqResBiConsumer() {
        return reqResBiConsumer;
    }

    public Class getBodyClassType() {
        return bodyClassType;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o)
            return true;
        if (o == null || getClass() != o.getClass())
            return false;
        Endpoint endpoint = (Endpoint) o;
        return Objects.equals(path, endpoint.path) && method == endpoint.method;
    }

    @Override
    public int hashCode() {
        return Objects.hash(path, method);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy