com.palantir.atlasdb.timelock.api.ConjureLockDescriptor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of timelock-api-objects Show documentation
Show all versions of timelock-api-objects Show documentation
Palantir open source project
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);
}
}