<?php

declare(strict_types=1);

namespace App\Framework\Deployment\Docker\ValueObjects;

/**
 * Container ID Value Object
 */
final readonly class ContainerId
{
    public function __construct(
        public string $value
    ) {
        if (empty($value)) {
            throw new \InvalidArgumentException('Container ID cannot be empty');
        }
    }

    public static function fromString(string $value): self
    {
        return new self($value);
    }

    public function equals(self $other): bool
    {
        return $this->value === $other->value;
    }

    public function __toString(): string
    {
        return $this->value;
    }
}
