Class Criterion.Builder

java.lang.Object
com.netflix.genie.common.dto.Criterion.Builder
Enclosing class:
Criterion

public static class Criterion.Builder extends Object
Builder for creating a Criterion instance.
Since:
4.0.0
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • withId

      public Criterion.Builder withId(@Nullable String id)
      Set the id of the resource (cluster, command, etc) to use.
      Parameters:
      id - The id
      Returns:
      The builder
    • withName

      public Criterion.Builder withName(@Nullable String name)
      Set the name of the resource (cluster, command, etc) to search for.
      Parameters:
      name - The name of the resource
      Returns:
      The builder
    • withVersion

      public Criterion.Builder withVersion(@Nullable String version)
      Set the version of the resource (cluster, command, etc) to search for.
      Parameters:
      version - The version of the resource
      Returns:
      The builder
    • withStatus

      public Criterion.Builder withStatus(@Nullable String status)
      Set the status to search for. Overrides default status of resource in search algorithm.
      Parameters:
      status - The status to override the default with
      Returns:
      The builder
    • withTags

      public Criterion.Builder withTags(@Nullable Set<String> tags)
      Set the tags to use in the search.
      Parameters:
      tags - The tags. Any blanks will be removed
      Returns:
      The builder
    • build

      public Criterion build() throws IllegalArgumentException
      Build an immutable Criterion. A precondition exception will be thrown if all of the fields are empty.
      Returns:
      A criterion which is completely immutable.
      Throws:
      IllegalArgumentException - A valid Criterion must have at least one field populated