Interface BooleanAppender
public interface BooleanAppender
A functional interface that takes and returns an object that is a CharSequence and is Appendable, appending
a
boolean item to it.
This is not typically a method reference to anything in Base, which is different from other Appender types.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BooleanAppenderAn alternative BooleanAppender constant that appends'1'when the given boolean item is true, or'0'when it is false.static final BooleanAppenderA static constant to avoid Android and its R8 compiler allocating a new lambda every timeStringBuilder::appendis present at a call-site.static final BooleanAppenderAppends boolean constants as they would be read in Java sources, as eithertrueorfalse. -
Method Summary
Modifier and TypeMethodDescriptionstatic <S extends CharSequence & Appendable>
Sappend(S sb, boolean item) static <S extends CharSequence & Appendable>
SappendBinary(S sb, boolean item) <S extends CharSequence & Appendable>
Sapply(S sb, boolean item) Appendsitemtosband returnssbfor chaining.
-
Field Details
-
DEFAULT
A static constant to avoid Android and its R8 compiler allocating a new lambda every timeStringBuilder::appendis present at a call-site. This should be used in place ofStringBuilder.append(boolean)when you want to use that as a BooleanAppender. -
BINARY
An alternative BooleanAppender constant that appends'1'when the given boolean item is true, or'0'when it is false. This is named differently from theDENSEmethod reference in other Appender functional interfaces because there's no need or ability to use base-90 digits to show true and false values densely.
This is a static constant to avoid Android and its R8 compiler allocating a new lambda every time this lambda would be present at a call-site. -
READABLE
Appends boolean constants as they would be read in Java sources, as eithertrueorfalse.
-
-
Method Details
-
apply
Appendsitemtosband returnssbfor chaining.- Type Parameters:
S- any type that is both a CharSequence and an Appendable, such as StringBuilder, StringBuffer, CharBuffer, or CharList- Parameters:
sb- an Appendable CharSequence that will be modified, such as a StringBuilderitem- the item to append- Returns:
first, after modification
-
append
-
appendBinary
-