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

dev.soffa.foundation.model.TenantId Maven / Gradle / Ivy

There is a newer version: 0.17.31
Show newest version
package dev.soffa.foundation.model;

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

@Value
public class TenantId {

    public static final String DEFAULT_VALUE = "default";
    public static final String CONTEXT_VALUE = "context";
    public static final TenantId CONTEXT = new TenantId(CONTEXT_VALUE);
    public static final TenantId DEFAULT = new TenantId(DEFAULT_VALUE);

    @JsonValue
    String value;

    @JsonCreator
    public TenantId(String value) {
        this.value = value;
    }

    public static TenantId of(String value) {
        if (value == null || value.isEmpty()) {
            return null;
        }
        return new TenantId(value);
    }

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

}






© 2015 - 2025 Weber Informatics LLC | Privacy Policy