Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Add boolean state checkers to LiveStreamState
Browse files Browse the repository at this point in the history
  • Loading branch information
sprain committed Mar 29, 2020
1 parent dbfe55e commit 5079215
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions lib/Wsc/Container/LiveStreamState.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@

class LiveStreamState
{
const STATE_STARTED = "started";
const STATE_STOPPED = "stopped";
const STATE_STARTING = "starting";
const STATE_STOPPING = "stopping";
const STATE_RESETTING = "resetting";

/**
* @var string
* @SerializedName("state")
Expand Down Expand Up @@ -44,4 +50,29 @@ public function setIpAddress(string $ipAddress): self

return $this;
}

public function isStarted(): bool
{
return $this->state === self::STATE_STARTED;
}

public function isStopped(): bool
{
return $this->state === self::STATE_STOPPED;
}

public function isStarting(): bool
{
return $this->state === self::STATE_STARTING;
}

public function isStopping(): bool
{
return $this->state === self::STATE_STOPPING;
}

public function isResetting(): bool
{
return $this->state === self::STATE_RESETTING;
}
}

0 comments on commit 5079215

Please sign in to comment.