com.palantir.atlasdb.timelock.api.ConjureLockTokenV2 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.logsafe.Preconditions;
import com.palantir.logsafe.Safe;
import java.util.UUID;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.annotation.processing.Generated;
@Safe
@Generated("com.palantir.conjure.java.types.AliasGenerator")
public final class ConjureLockTokenV2 {
private final @Safe UUID value;
private ConjureLockTokenV2(@Nonnull @Safe UUID value) {
this.value = Preconditions.checkNotNull(value, "value cannot be null");
}
@JsonValue
public @Safe UUID get() {
return value;
}
@Override
@Safe
public String toString() {
return value.toString();
}
@Override
public boolean equals(@Nullable Object other) {
return this == other || (other instanceof ConjureLockTokenV2 && equalTo((ConjureLockTokenV2) other));
}
private boolean equalTo(ConjureLockTokenV2 other) {
return this.value.equals(other.value);
}
@Override
public int hashCode() {
return this.value.hashCode();
}
public static ConjureLockTokenV2 valueOf(@Safe String value) {
return of(UUID.fromString(value));
}
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
public static ConjureLockTokenV2 of(@Nonnull @Safe UUID value) {
return new ConjureLockTokenV2(value);
}
}