Class ElementScopes.Builder

java.lang.Object
dev.getelements.elements.sdk.util.ElementScopes.Builder
Enclosing class:
ElementScopes

public static class ElementScopes.Builder extends Object
Builder class for ElementScopes.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • withName

      public ElementScopes.Builder withName(String name)
      Specifies the name of the scope.
      Parameters:
      name - the name
      Returns:
      this builder
    • withNameFrom

      public ElementScopes.Builder withNameFrom(Class<?> aClass)
      Specifies the name of the scope, using the supplied Class.getName() as the name.
      Parameters:
      aClass - name
      Returns:
      this builder
    • withLogger

      public ElementScopes.Builder withLogger(org.slf4j.Logger logger)
      The logger to use.
      Parameters:
      logger - the logger
      Returns:
      the logger
    • withRegistry

      public ElementScopes.Builder withRegistry(ElementRegistry registry)
      Sets the registry to be used.
      Parameters:
      registry - the registry
      Returns:
      this builder
    • withSelector

      public ElementScopes.Builder withSelector(Predicate<Element> selector)
      Sets the selector to be used.
      Parameters:
      selector - the selector
      Returns:
      this builder
    • withElementsNamed

      public ElementScopes.Builder withElementsNamed(String... names)
      Sets the selector to include elements with the specified names.
      Parameters:
      names - the names of the elements
      Returns:
      this builder
    • withAttributes

      public ElementScopes.Builder withAttributes(Attributes attributes)
      Sets the Attributes to assign to the scope.
      Parameters:
      attributes - the attributes to assign
      Returns:
      this builder
    • build

      public ElementScopes build()
      Creates a new instance of ElementScopes with the specified parameters.
      Returns:
      the new instance