Class GHRepositoryVariableBuilder<S>

java.lang.Object
org.kohsuke.github.GHRepositoryVariableBuilder<S>
Type Parameters:
S - the type parameter
All Implemented Interfaces:
GitHubRequestBuilderDone<GHRepositoryVariable>
Direct Known Subclasses:
GHRepositoryVariable.Creator, GHRepositoryVariable.Setter

public class GHRepositoryVariableBuilder<S> extends Object
The type Gh repository variable builder.
  • Field Details

    • requester

      @Nonnull protected final org.kohsuke.github.Requester requester
      The requester.
    • updateInPlace

      protected boolean updateInPlace
      The update in place.
  • Constructor Details

    • GHRepositoryVariableBuilder

      protected GHRepositoryVariableBuilder(@Nonnull Class<S> intermediateReturnType, @Nonnull GitHub root, @CheckForNull GHRepositoryVariable baseInstance)
      Instantiates a new GH Repository Variable builder.
      Parameters:
      intermediateReturnType - Intermediate return type for this builder returned by calls to with(String, Object). If S the same as GHRepositoryVariable, this builder will commit changes after each call to with(String, Object).
      root - the GitHub instance to which updates will be sent
      baseInstance - instance on which to base this builder. If null a new instance will be created.
  • Method Details

    • name

      @Nonnull @BetaApi public S name(String value) throws IOException
      Name.
      Parameters:
      value - the value
      Returns:
      the s
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • value

      @Nonnull @BetaApi public S value(String value) throws IOException
      Name.
      Parameters:
      value - the value
      Returns:
      the s
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • done

      @Nonnull @BetaApi public GHRepositoryVariable done() throws IOException
      Finishes a create or update request, committing changes. This method may update-in-place or not. Either way it returns the resulting instance.
      Specified by:
      done in interface GitHubRequestBuilderDone<R>
      Returns:
      an instance with updated current data
      Throws:
      IOException - if there is an I/O Exception
    • with

      @Nonnull @BetaApi protected S with(@Nonnull String name, Object value) throws IOException
      Applies a value to a name for this builder. If S is the same as R, this method will commit changes after the first value change and return a R from GitHubRequestBuilderDone.done(). If S is not the same as R, this method will return an S and letting the caller batch together multiple changes and call GitHubRequestBuilderDone.done() when they are ready.
      Parameters:
      name - the name of the field
      value - the value of the field
      Returns:
      either a continuing builder or an updated data record
      Throws:
      IOException - if an I/O error occurs
    • continueOrDone

      @Nonnull @BetaApi protected S continueOrDone() throws IOException
      Chooses whether to return a continuing builder or an updated data record If S is the same as R, this method will commit changes after the first value change and return a R from GitHubRequestBuilderDone.done(). If S is not the same as R, this method will return an S and letting the caller batch together multiple changes and call GitHubRequestBuilderDone.done() when they are ready.
      Returns:
      either a continuing builder or an updated data record
      Throws:
      IOException - if an I/O error occurs