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

com.palantir.atlasdb.timelock.api.ConjureLockDescriptor 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.conjure.java.lib.Bytes;
import com.palantir.logsafe.Preconditions;
import com.palantir.logsafe.Unsafe;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.annotation.processing.Generated;

@Unsafe
@Generated("com.palantir.conjure.java.types.AliasGenerator")
public final class ConjureLockDescriptor {
    private final @Unsafe Bytes value;

    private ConjureLockDescriptor(@Nonnull @Unsafe Bytes value) {
        this.value = Preconditions.checkNotNull(value, "value cannot be null");
    }

    @JsonValue
    public @Unsafe Bytes get() {
        return value;
    }

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

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

    private boolean equalTo(ConjureLockDescriptor other) {
        return this.value.equals(other.value);
    }

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

    @JsonCreator(mode = JsonCreator.Mode.DELEGATING)
    public static ConjureLockDescriptor of(@Nonnull @Unsafe Bytes value) {
        return new ConjureLockDescriptor(value);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy