Class Scopes

java.lang.Object
land.oras.auth.Scopes

@NullMarked public final class Scopes extends Object
Store scopes
  • Method Details

    • of

      public static Scopes of(Registry registry, ContainerRef containerRef, Scope... scopes)
      Create a new Scopes object
      Parameters:
      registry - The registry
      containerRef - The container reference
      scopes - The scopes
      Returns:
      A new Scopes object
    • empty

      public static Scopes empty(Registry registry, ContainerRef containerRef)
      Create a new Scopes object with no scopes
      Parameters:
      registry - The registry
      containerRef - The container reference
      Returns:
      A new Scopes object with no scopes
    • withRegistryScopes

      public Scopes withRegistryScopes(Scope... scopes)
      Return a new copy of the Scopes object with the given scopes
      Parameters:
      scopes - The scopes to set
      Returns:
      A new Scopes object with the given scopes
    • withNewRegistryScopes

      public Scopes withNewRegistryScopes(Scope... newScopes)
      Return a new copy of the Scopes object with the given scopes
      Parameters:
      newScopes - The scopes to add
      Returns:
      A new Scopes object with the given scopes
    • withNewScope

      public Scopes withNewScope(String scope)
      Return a new copy of the Scopes object with the given scope
      Parameters:
      scope - The scope to add
      Returns:
      A new Scopes object with the given scope
    • getScopes

      public List<String> getScopes()
      Get the scopes
      Returns:
      The scopes
    • getRegistry

      public String getRegistry()
      Get the registry
      Returns:
      The registry
    • getContainerRef

      public ContainerRef getContainerRef()
      Get the container reference
      Returns:
      The container reference