Package org.kohsuke.github
Class GHRepositoryVariableBuilder<S>
- java.lang.Object
-
- org.kohsuke.github.GHRepositoryVariableBuilder<S>
-
- Type Parameters:
S- the type parameter
- Direct Known Subclasses:
GHRepositoryVariable.Creator,GHRepositoryVariable.Setter
public class GHRepositoryVariableBuilder<S> extends Object
The type Gh repository variable builder.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.kohsuke.github.RequesterrequesterThe requester.protected booleanupdateInPlaceThe update in place.
-
Constructor Summary
Constructors Modifier Constructor Description protectedGHRepositoryVariableBuilder(Class<S> intermediateReturnType, GitHub root, GHRepositoryVariable baseInstance)Instantiates a new GH Repository Variable builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected ScontinueOrDone()Chooses whether to return a continuing builder or an updated data record IfAbstractBuilderis the same asAbstractBuilder, this method will commit changes after the first value change and return aAbstractBuilderfromdone().Rdone()Finishes an update, committing changes.GitHubgetRoot()Deprecated.For access to theGitHubinstance, use a local copy instead of pulling it out of objects.Sname(String value)Name.Svalue(String value)Name.protected Swith(String name, Object value)Applies a value to a name for this builder.
-
-
-
Field Detail
-
requester
@Nonnull protected final org.kohsuke.github.Requester requester
The requester.
-
updateInPlace
protected boolean updateInPlace
The update in place.
-
-
Constructor Detail
-
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 towith(String, Object). IfGHRepositoryVariableBuilderthe same asGHRepositoryVariable, this builder will commit changes after each call towith(String, Object).root- the GitHub instance to which updates will be sentbaseInstance- instance on which to base this builder. Ifnulla new instance will be created.
-
-
Method Detail
-
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 R done() throws IOException
Finishes an update, committing changes. This method may update-in-place or not. Either way it returns the resulting instance.- 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. IfAbstractBuilderis the same asAbstractBuilder, this method will commit changes after the first value change and return aAbstractBuilderfromdone(). IfAbstractBuilderis not the same asAbstractBuilder, this method will return anAbstractBuilderand letting the caller batch together multiple changes and calldone()when they are ready.- Parameters:
name- the name of the fieldvalue- 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 IfAbstractBuilderis the same asAbstractBuilder, this method will commit changes after the first value change and return aAbstractBuilderfromdone(). IfAbstractBuilderis not the same asAbstractBuilder, this method will return anAbstractBuilderand letting the caller batch together multiple changes and calldone()when they are ready.- Returns:
- either a continuing builder or an updated data record
- Throws:
IOException- if an I/O error occurs
-
getRoot
@Deprecated public GitHub getRoot()
Deprecated.For access to theGitHubinstance, use a local copy instead of pulling it out of objects.Get the rootGitHubinstance for this object.- Returns:
- the root
GitHubinstance
-
-