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

ca.ibodrov.mica.api.model.ProfileId Maven / Gradle / Ivy

There is a newer version: 0.0.25
Show newest version
package ca.ibodrov.mica.api.model;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

import java.util.Optional;
import java.util.UUID;

import static com.fasterxml.jackson.annotation.JsonCreator.Mode.DELEGATING;
import static java.util.Objects.requireNonNull;

public record ProfileId(UUID id) {

    public static Optional of(UUID id) {
        return Optional.of(id).map(ProfileId::new);
    }

    @JsonCreator(mode = DELEGATING)
    public ProfileId {
        requireNonNull(id);
    }

    @Override
    @JsonValue
    public UUID id() {
        return id;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy