package com.social.media.domain.user.valueobject;

import java.util.Objects;

/**
 * Value Object representing a User ID
 */
public record UserId(Long value) {
    
    public UserId {
        Objects.requireNonNull(value, "User ID cannot be null");
        if (value <= 0) {
            throw new IllegalArgumentException("User ID must be positive");
        }
    }
    
    public static UserId of(Long value) {
        return new UserId(value);
    }
    
    public static UserId of(String value) {
        return new UserId(Long.valueOf(value));
    }
    
    @Override
    public String toString() {
        return String.valueOf(value);
    }
}
