Skip to content

StringSignal

class StringSignal
Extends: Signal<String>
Package: dev.joid.lib.signal.impl.primitive · Module: core · Source: StringSignal.java

Signal of a String with the text operations of String, which write their result.

It works like Signal; each operation applies the method of the same name of String to the value and writes the result. An index outside the text throws a StringIndexOutOfBoundsException when the write applies.

ReturnsSignatureSummary
StringSignal()Creates a signal whose value and default value are the empty text "".
StringSignal(String value)Creates a signal whose value and default value are value.

ReturnsSignatureSummary
thisappend(String value) fluentAdds value at the end of the text, then returns this signal; null adds the text "null".
thisreplace(char oldChar, char newChar) fluentReplaces every oldChar with newChar, then returns this signal.
thisreplace(CharSequence target, CharSequence replacement) fluentReplaces every occurrence of target with replacement, then returns this signal.
thistoLowerCase() fluentWrites the text in lower case, with the rules of the default locale, then returns this signal.
thistoUpperCase() fluentWrites the text in upper case, with the rules of the default locale, then returns this signal.
thistrim() fluentRemoves the spaces and control characters at both ends of the text, then returns this signal.
thissubstring(int beginIndex) fluentKeeps the text from beginIndex to its end, then returns this signal.
thissubstring(int beginIndex, int endIndex) fluentKeeps the text from beginIndex included to endIndex excluded, then returns this signal.
Inherited from Signal (12)

batch · silent · get · peek · isPresent · isWritable · toString · from · set · reset · removeOnChange · map

Inherited from Signal (1)

onChange

StringSignal()

Creates a signal whose value and default value are the empty text "".

StringSignal(String value)

Creates a signal whose value and default value are value.

this append(String value) fluent

Adds value at the end of the text, then returns this signal; null adds the text "null".

this replace(char oldChar, char newChar) fluent

Replaces every oldChar with newChar, then returns this signal.

this replace(CharSequence target, CharSequence replacement) fluent

Replaces every occurrence of target with replacement, then returns this signal.

this toLowerCase() fluent

Writes the text in lower case, with the rules of the default locale, then returns this signal.

this toUpperCase() fluent

Writes the text in upper case, with the rules of the default locale, then returns this signal.

this trim() fluent

Removes the spaces and control characters at both ends of the text, then returns this signal.

this substring(int beginIndex) fluent

Keeps the text from beginIndex to its end, then returns this signal.

this substring(int beginIndex, int endIndex) fluent

Keeps the text from beginIndex included to endIndex excluded, then returns this signal.


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page