Package com.github.searls.jasmine.model
Class ImmutableScriptSearch.Builder
- java.lang.Object
-
- com.github.searls.jasmine.model.ImmutableScriptSearch.Builder
-
- Enclosing class:
- ImmutableScriptSearch
@NotThreadSafe public static final class ImmutableScriptSearch.Builder extends Object
Builds instances of typeImmutableScriptSearch. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableScriptSearch.Builder from(ScriptSearch instance)
Fill a builder with attribute values from the providedScriptSearchinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
directory
@CanIgnoreReturnValue public final ImmutableScriptSearch.Builder directory(File directory)
Initializes the value for thedirectoryattribute.- Parameters:
directory- The value for directory- Returns:
thisbuilder for use in a chained invocation
-
addIncludes
@CanIgnoreReturnValue public final ImmutableScriptSearch.Builder addIncludes(String element)
Adds one element toincludeslist.- Parameters:
element- A includes element- Returns:
thisbuilder for use in a chained invocation
-
addIncludes
@CanIgnoreReturnValue public final ImmutableScriptSearch.Builder addIncludes(String... elements)
Adds elements toincludeslist.- Parameters:
elements- An array of includes elements- Returns:
thisbuilder for use in a chained invocation
-
includes
@CanIgnoreReturnValue public final ImmutableScriptSearch.Builder includes(Iterable<String> elements)
Sets or replaces all elements forincludeslist.- Parameters:
elements- An iterable of includes elements- Returns:
thisbuilder for use in a chained invocation
-
addAllIncludes
@CanIgnoreReturnValue public final ImmutableScriptSearch.Builder addAllIncludes(Iterable<String> elements)
Adds elements toincludeslist.- Parameters:
elements- An iterable of includes elements- Returns:
thisbuilder for use in a chained invocation
-
addExcludes
@CanIgnoreReturnValue public final ImmutableScriptSearch.Builder addExcludes(String element)
Adds one element toexcludeslist.- Parameters:
element- A excludes element- Returns:
thisbuilder for use in a chained invocation
-
addExcludes
@CanIgnoreReturnValue public final ImmutableScriptSearch.Builder addExcludes(String... elements)
Adds elements toexcludeslist.- Parameters:
elements- An array of excludes elements- Returns:
thisbuilder for use in a chained invocation
-
excludes
@CanIgnoreReturnValue public final ImmutableScriptSearch.Builder excludes(Iterable<String> elements)
Sets or replaces all elements forexcludeslist.- Parameters:
elements- An iterable of excludes elements- Returns:
thisbuilder for use in a chained invocation
-
addAllExcludes
@CanIgnoreReturnValue public final ImmutableScriptSearch.Builder addAllExcludes(Iterable<String> elements)
Adds elements toexcludeslist.- Parameters:
elements- An iterable of excludes elements- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableScriptSearch build()
Builds a newImmutableScriptSearch.- Returns:
- An immutable instance of ScriptSearch
- Throws:
IllegalStateException- if any required attributes are missing
-
-