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

com.palantir.atlasdb.timelock.api.ConjureLockTokenV2 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.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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy