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

com.palantir.atlasdb.timelock.api.ConjureRefreshLocksRequestV2 Maven / Gradle / Ivy

There is a newer version: 0.1152.0
Show newest version
package com.palantir.atlasdb.timelock.api;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.palantir.logsafe.Preconditions;
import com.palantir.logsafe.Safe;
import java.util.Collections;
import java.util.Set;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.annotation.processing.Generated;

@Safe
@Generated("com.palantir.conjure.java.types.AliasGenerator")
public final class ConjureRefreshLocksRequestV2 {
    private static final ConjureRefreshLocksRequestV2 EMPTY = new ConjureRefreshLocksRequestV2();

    private final Set value;

    private int memoizedHashCode;

    private ConjureRefreshLocksRequestV2(@Nonnull Set value) {
        this.value = Preconditions.checkNotNull(value, "value cannot be null");
    }

    private ConjureRefreshLocksRequestV2() {
        this(Collections.emptySet());
    }

    @JsonValue
    public Set get() {
        return value;
    }

    @Override
    public String toString() {
        return value.toString();
    }

    @Override
    public boolean equals(@Nullable Object other) {
        return this == other
                || (other instanceof ConjureRefreshLocksRequestV2 && equalTo((ConjureRefreshLocksRequestV2) other));
    }

    private boolean equalTo(ConjureRefreshLocksRequestV2 other) {
        if (this.memoizedHashCode != 0
                && other.memoizedHashCode != 0
                && this.memoizedHashCode != other.memoizedHashCode) {
            return false;
        }
        return this.value.equals(other.value);
    }

    @Override
    public int hashCode() {
        int result = memoizedHashCode;
        if (result == 0) {
            result = this.value.hashCode();
            memoizedHashCode = result;
        }
        return result;
    }

    @JsonCreator(mode = JsonCreator.Mode.DELEGATING)
    public static ConjureRefreshLocksRequestV2 of(@Nonnull Set value) {
        return new ConjureRefreshLocksRequestV2(value);
    }

    public static ConjureRefreshLocksRequestV2 empty() {
        return EMPTY;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy