MCPcopy Create free account
hub / github.com/apache/commons-lang / Builder

Class Builder

src/main/java/org/apache/commons/lang3/Strings.java:37–86  ·  view source on GitHub ↗

Builds Strings instances.

Source from the content-addressed store, hash-verified

35 * Builds {@link Strings} instances.
36 */
37 public static class Builder extends AbstractSupplier<Strings, Builder, RuntimeException> {
38
39 /**
40 * Ignores case when possible.
41 */
42 private boolean ignoreCase;
43
44 /**
45 * Compares null as less when possible.
46 */
47 private boolean nullIsLess;
48
49 /**
50 * Constructs a new instance.
51 */
52 private Builder() {
53 // empty
54 }
55
56 /**
57 * Gets a new {@link Strings} instance.
58 */
59 @Override
60 public Strings get() {
61 return ignoreCase ? new CiStrings(nullIsLess) : new CsStrings(nullIsLess);
62 }
63
64 /**
65 * Sets the ignoreCase property for new Strings instances.
66 *
67 * @param ignoreCase the ignoreCase property for new Strings instances.
68 * @return {@code this} instance.
69 */
70 public Builder setIgnoreCase(final boolean ignoreCase) {
71 this.ignoreCase = ignoreCase;
72 return asThis();
73 }
74
75 /**
76 * Sets the nullIsLess property for new Strings instances.
77 *
78 * @param nullIsLess the nullIsLess property for new Strings instances.
79 * @return {@code this} instance.
80 */
81 public Builder setNullIsLess(final boolean nullIsLess) {
82 this.nullIsLess = nullIsLess;
83 return asThis();
84 }
85
86 }
87
88 /**
89 * Case-insensitive extension.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…