Package com.facebook.buck.shell
Class WorkerToolDescriptionArg.Builder
- java.lang.Object
-
- com.facebook.buck.shell.WorkerToolDescriptionArg.Builder
-
- Enclosing class:
- WorkerToolDescriptionArg
@NotThreadSafe public static final class WorkerToolDescriptionArg.Builder extends Object
Builds instances of typeWorkerToolDescriptionArg
. Initialize attributes and then invoke thebuild()
method to create an immutable instance.Builder
is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WorkerToolDescriptionArg.Builder
addAllCompatibleWith(Iterable<? extends UnconfiguredBuildTarget> elements)
Adds elements tocompatibleWith
list.WorkerToolDescriptionArg.Builder
addAllLabels(Iterable<String> elements)
Adds elements tolabels
sortedSet.WorkerToolDescriptionArg.Builder
addAllLicenses(Iterable<? extends SourcePath> elements)
Adds elements tolicenses
set.WorkerToolDescriptionArg.Builder
addCompatibleWith(UnconfiguredBuildTarget element)
Adds one element tocompatibleWith
list.WorkerToolDescriptionArg.Builder
addCompatibleWith(UnconfiguredBuildTarget... elements)
Adds elements tocompatibleWith
list.WorkerToolDescriptionArg.Builder
addLabels(String element)
Adds one element tolabels
sortedSet.WorkerToolDescriptionArg.Builder
addLabels(String... elements)
Adds elements tolabels
sortedSet.WorkerToolDescriptionArg.Builder
addLicenses(SourcePath element)
Adds one element tolicenses
set.WorkerToolDescriptionArg.Builder
addLicenses(SourcePath... elements)
Adds elements tolicenses
set.WorkerToolDescriptionArg
build()
Builds a newWorkerToolDescriptionArg
.WorkerToolDescriptionArg.Builder
from(BuildRuleArg instance)
Fill a builder with attribute values from the providedcom.facebook.buck.core.description.arg.BuildRuleArg
instance.WorkerToolDescriptionArg.Builder
from(ConstructorArg instance)
Fill a builder with attribute values from the providedcom.facebook.buck.core.description.arg.ConstructorArg
instance.WorkerToolDescriptionArg.Builder
from(com.facebook.buck.shell.WorkerToolDescription.AbstractWorkerToolDescriptionArg instance)
Copy abstract value typeAbstractWorkerToolDescriptionArg
instance into builder.WorkerToolDescriptionArg.Builder
from(WorkerToolDescriptionArg instance)
Fill a builder with attribute values from the providedWorkerToolDescriptionArg
instance.WorkerToolDescriptionArg.Builder
putAllEnv(Map<String,? extends StringWithMacros> entries)
Put all mappings from the specified map as entries toenv
map.WorkerToolDescriptionArg.Builder
putEnv(String key, StringWithMacros value)
Put one entry to theenv
map.WorkerToolDescriptionArg.Builder
putEnv(Map.Entry<String,? extends StringWithMacros> entry)
Put one entry to theenv
map.WorkerToolDescriptionArg.Builder
setArgs(Either<StringWithMacros,com.google.common.collect.ImmutableList<StringWithMacros>> args)
Initializes the value for theargs
attribute.WorkerToolDescriptionArg.Builder
setCompatibleWith(Iterable<? extends UnconfiguredBuildTarget> elements)
Sets or replaces all elements forcompatibleWith
list.WorkerToolDescriptionArg.Builder
setDefaultTargetPlatform(UnconfiguredBuildTarget defaultTargetPlatform)
Initializes the optional valuedefaultTargetPlatform
to defaultTargetPlatform.WorkerToolDescriptionArg.Builder
setDefaultTargetPlatform(Optional<? extends UnconfiguredBuildTarget> defaultTargetPlatform)
Initializes the optional valuedefaultTargetPlatform
to defaultTargetPlatform.WorkerToolDescriptionArg.Builder
setEnv(Map<String,? extends StringWithMacros> entries)
Sets or replaces all mappings from the specified map as entries for theenv
map.WorkerToolDescriptionArg.Builder
setExe(BuildTarget exe)
Initializes the optional valueexe
to exe.WorkerToolDescriptionArg.Builder
setExe(Optional<? extends BuildTarget> exe)
Initializes the optional valueexe
to exe.WorkerToolDescriptionArg.Builder
setLabels(Iterable<String> elements)
Sets or replaces all elements forlabels
sortedSet.WorkerToolDescriptionArg.Builder
setLicenses(Iterable<? extends SourcePath> elements)
Sets or replaces all elements forlicenses
set.WorkerToolDescriptionArg.Builder
setMaxWorkers(int maxWorkers)
Initializes the optional valuemaxWorkers
to maxWorkers.WorkerToolDescriptionArg.Builder
setMaxWorkers(Optional<Integer> maxWorkers)
Initializes the optional valuemaxWorkers
to maxWorkers.WorkerToolDescriptionArg.Builder
setMaxWorkersPerThreadPercent(int maxWorkersPerThreadPercent)
Initializes the optional valuemaxWorkersPerThreadPercent
to maxWorkersPerThreadPercent.WorkerToolDescriptionArg.Builder
setMaxWorkersPerThreadPercent(Optional<Integer> maxWorkersPerThreadPercent)
Initializes the optional valuemaxWorkersPerThreadPercent
to maxWorkersPerThreadPercent.WorkerToolDescriptionArg.Builder
setName(String name)
Initializes the value for thename
attribute.WorkerToolDescriptionArg.Builder
setPersistent(boolean persistent)
Initializes the optional valuepersistent
to persistent.WorkerToolDescriptionArg.Builder
setPersistent(Optional<Boolean> persistent)
Initializes the optional valuepersistent
to persistent.WorkerToolDescriptionArg.Builder
setSoloAsync(boolean soloAsync)
Initializes the optional valuesoloAsync
to soloAsync.WorkerToolDescriptionArg.Builder
setSoloAsync(Optional<Boolean> soloAsync)
Initializes the optional valuesoloAsync
to soloAsync.
-
-
-
Method Detail
-
from
public final WorkerToolDescriptionArg.Builder from(WorkerToolDescriptionArg instance)
Fill a builder with attribute values from the providedWorkerToolDescriptionArg
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
from
public final WorkerToolDescriptionArg.Builder from(com.facebook.buck.shell.WorkerToolDescription.AbstractWorkerToolDescriptionArg instance)
Copy abstract value typeAbstractWorkerToolDescriptionArg
instance into builder.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
from
public final WorkerToolDescriptionArg.Builder from(BuildRuleArg instance)
Fill a builder with attribute values from the providedcom.facebook.buck.core.description.arg.BuildRuleArg
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
from
public final WorkerToolDescriptionArg.Builder from(ConstructorArg instance)
Fill a builder with attribute values from the providedcom.facebook.buck.core.description.arg.ConstructorArg
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
putEnv
public final WorkerToolDescriptionArg.Builder putEnv(String key, StringWithMacros value)
Put one entry to theenv
map.- Parameters:
key
- The key in the env mapvalue
- The associated value in the env map- Returns:
this
builder for use in a chained invocation
-
putEnv
public final WorkerToolDescriptionArg.Builder putEnv(Map.Entry<String,? extends StringWithMacros> entry)
Put one entry to theenv
map. Nulls are not permitted- Parameters:
entry
- The key and value entry- Returns:
this
builder for use in a chained invocation
-
setEnv
public final WorkerToolDescriptionArg.Builder setEnv(Map<String,? extends StringWithMacros> entries)
Sets or replaces all mappings from the specified map as entries for theenv
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the env map- Returns:
this
builder for use in a chained invocation
-
putAllEnv
public final WorkerToolDescriptionArg.Builder putAllEnv(Map<String,? extends StringWithMacros> entries)
Put all mappings from the specified map as entries toenv
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the env map- Returns:
this
builder for use in a chained invocation
-
setArgs
public final WorkerToolDescriptionArg.Builder setArgs(Either<StringWithMacros,com.google.common.collect.ImmutableList<StringWithMacros>> args)
Initializes the value for theargs
attribute.If not set, this attribute will have a default value as returned by the initializer of
args
.- Parameters:
args
- The value for args- Returns:
this
builder for use in a chained invocation
-
setExe
public final WorkerToolDescriptionArg.Builder setExe(BuildTarget exe)
Initializes the optional valueexe
to exe.- Parameters:
exe
- The value for exe- Returns:
this
builder for chained invocation
-
setExe
public final WorkerToolDescriptionArg.Builder setExe(Optional<? extends BuildTarget> exe)
Initializes the optional valueexe
to exe.- Parameters:
exe
- The value for exe- Returns:
this
builder for use in a chained invocation
-
setMaxWorkers
public final WorkerToolDescriptionArg.Builder setMaxWorkers(int maxWorkers)
Initializes the optional valuemaxWorkers
to maxWorkers.- Parameters:
maxWorkers
- The value for maxWorkers- Returns:
this
builder for chained invocation
-
setMaxWorkers
public final WorkerToolDescriptionArg.Builder setMaxWorkers(Optional<Integer> maxWorkers)
Initializes the optional valuemaxWorkers
to maxWorkers.- Parameters:
maxWorkers
- The value for maxWorkers- Returns:
this
builder for use in a chained invocation
-
setMaxWorkersPerThreadPercent
public final WorkerToolDescriptionArg.Builder setMaxWorkersPerThreadPercent(int maxWorkersPerThreadPercent)
Initializes the optional valuemaxWorkersPerThreadPercent
to maxWorkersPerThreadPercent.- Parameters:
maxWorkersPerThreadPercent
- The value for maxWorkersPerThreadPercent- Returns:
this
builder for chained invocation
-
setMaxWorkersPerThreadPercent
public final WorkerToolDescriptionArg.Builder setMaxWorkersPerThreadPercent(Optional<Integer> maxWorkersPerThreadPercent)
Initializes the optional valuemaxWorkersPerThreadPercent
to maxWorkersPerThreadPercent.- Parameters:
maxWorkersPerThreadPercent
- The value for maxWorkersPerThreadPercent- Returns:
this
builder for use in a chained invocation
-
setPersistent
public final WorkerToolDescriptionArg.Builder setPersistent(boolean persistent)
Initializes the optional valuepersistent
to persistent.- Parameters:
persistent
- The value for persistent- Returns:
this
builder for chained invocation
-
setPersistent
public final WorkerToolDescriptionArg.Builder setPersistent(Optional<Boolean> persistent)
Initializes the optional valuepersistent
to persistent.- Parameters:
persistent
- The value for persistent- Returns:
this
builder for use in a chained invocation
-
setSoloAsync
public final WorkerToolDescriptionArg.Builder setSoloAsync(boolean soloAsync)
Initializes the optional valuesoloAsync
to soloAsync.- Parameters:
soloAsync
- The value for soloAsync- Returns:
this
builder for chained invocation
-
setSoloAsync
public final WorkerToolDescriptionArg.Builder setSoloAsync(Optional<Boolean> soloAsync)
Initializes the optional valuesoloAsync
to soloAsync.- Parameters:
soloAsync
- The value for soloAsync- Returns:
this
builder for use in a chained invocation
-
addLicenses
public final WorkerToolDescriptionArg.Builder addLicenses(SourcePath element)
Adds one element tolicenses
set.- Parameters:
element
- A licenses element- Returns:
this
builder for use in a chained invocation
-
addLicenses
public final WorkerToolDescriptionArg.Builder addLicenses(SourcePath... elements)
Adds elements tolicenses
set.- Parameters:
elements
- An array of licenses elements- Returns:
this
builder for use in a chained invocation
-
setLicenses
public final WorkerToolDescriptionArg.Builder setLicenses(Iterable<? extends SourcePath> elements)
Sets or replaces all elements forlicenses
set.- Parameters:
elements
- An iterable of licenses elements- Returns:
this
builder for use in a chained invocation
-
addAllLicenses
public final WorkerToolDescriptionArg.Builder addAllLicenses(Iterable<? extends SourcePath> elements)
Adds elements tolicenses
set.- Parameters:
elements
- An iterable of licenses elements- Returns:
this
builder for use in a chained invocation
-
addLabels
public final WorkerToolDescriptionArg.Builder addLabels(String element)
Adds one element tolabels
sortedSet.- Parameters:
element
- A labels element- Returns:
this
builder for use in a chained invocation
-
addLabels
public final WorkerToolDescriptionArg.Builder addLabels(String... elements)
Adds elements tolabels
sortedSet.- Parameters:
elements
- An array of labels elements- Returns:
this
builder for use in a chained invocation
-
setLabels
public final WorkerToolDescriptionArg.Builder setLabels(Iterable<String> elements)
Sets or replaces all elements forlabels
sortedSet.- Parameters:
elements
- An iterable of labels elements- Returns:
this
builder for use in a chained invocation
-
addAllLabels
public final WorkerToolDescriptionArg.Builder addAllLabels(Iterable<String> elements)
Adds elements tolabels
sortedSet.- Parameters:
elements
- An iterable of labels elements- Returns:
this
builder for use in a chained invocation
-
setDefaultTargetPlatform
public final WorkerToolDescriptionArg.Builder setDefaultTargetPlatform(UnconfiguredBuildTarget defaultTargetPlatform)
Initializes the optional valuedefaultTargetPlatform
to defaultTargetPlatform.- Parameters:
defaultTargetPlatform
- The value for defaultTargetPlatform- Returns:
this
builder for chained invocation
-
setDefaultTargetPlatform
public final WorkerToolDescriptionArg.Builder setDefaultTargetPlatform(Optional<? extends UnconfiguredBuildTarget> defaultTargetPlatform)
Initializes the optional valuedefaultTargetPlatform
to defaultTargetPlatform.- Parameters:
defaultTargetPlatform
- The value for defaultTargetPlatform- Returns:
this
builder for use in a chained invocation
-
addCompatibleWith
public final WorkerToolDescriptionArg.Builder addCompatibleWith(UnconfiguredBuildTarget element)
Adds one element tocompatibleWith
list.- Parameters:
element
- A compatibleWith element- Returns:
this
builder for use in a chained invocation
-
addCompatibleWith
public final WorkerToolDescriptionArg.Builder addCompatibleWith(UnconfiguredBuildTarget... elements)
Adds elements tocompatibleWith
list.- Parameters:
elements
- An array of compatibleWith elements- Returns:
this
builder for use in a chained invocation
-
setCompatibleWith
public final WorkerToolDescriptionArg.Builder setCompatibleWith(Iterable<? extends UnconfiguredBuildTarget> elements)
Sets or replaces all elements forcompatibleWith
list.- Parameters:
elements
- An iterable of compatibleWith elements- Returns:
this
builder for use in a chained invocation
-
addAllCompatibleWith
public final WorkerToolDescriptionArg.Builder addAllCompatibleWith(Iterable<? extends UnconfiguredBuildTarget> elements)
Adds elements tocompatibleWith
list.- Parameters:
elements
- An iterable of compatibleWith elements- Returns:
this
builder for use in a chained invocation
-
setName
public final WorkerToolDescriptionArg.Builder setName(String name)
Initializes the value for thename
attribute.- Parameters:
name
- The value for name- Returns:
this
builder for use in a chained invocation
-
build
public WorkerToolDescriptionArg build()
Builds a newWorkerToolDescriptionArg
.- Returns:
- An immutable instance of WorkerToolDescriptionArg
- Throws:
IllegalStateException
- if any required attributes are missing
-
-