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

org.mockserver.model.ExpectationId Maven / Gradle / Ivy

There is a newer version: 5.15.0
Show newest version
package org.mockserver.model;

import java.util.Objects;

public class ExpectationId extends ObjectWithJsonToString {

    private int hashCode;
    private String id;

    public static ExpectationId expectationId(String id) {
        return new ExpectationId().withId(id);
    }

    public String getId() {
        return id;
    }

    public ExpectationId withId(String id) {
        this.id = id;
        return this;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        if (hashCode() != o.hashCode()) {
            return false;
        }
        ExpectationId that = (ExpectationId) o;
        return Objects.equals(id, that.id);
    }

    @Override
    public int hashCode() {
        if (hashCode == 0) {
            hashCode = Objects.hash(id);
        }
        return hashCode;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy