java.lang.Object
io.quarkus.gizmo2.creator.ops.ObjectOps
io.quarkus.gizmo2.creator.ops.StringBuilderOps
- All Implemented Interfaces:
ComparableOps
Operations on
StringBuilder. The expected usage pattern is:
- Create an instance using
BlockCreator.withNewStringBuilder() - Append to it using
append(Expr) - Create the final string using
ObjectOps.toString_()
StringBuilder
that this class doesn't provide, you should create an instance
using BlockCreator.withStringBuilder(Expr), which allows
you to pass an already created StringBuilder. This class
itself doesn't provide access to the underlying object.-
Constructor Summary
ConstructorsConstructorDescriptionConstruct a new instance on a newly createdStringBuilder.StringBuilderOps(BlockCreator bc, int capacity) Construct a new instance on a newly createdStringBuilderwith givencapacity.StringBuilderOps(BlockCreator bc, Expr obj) Construct a new instance on an existingStringBuilder. -
Method Summary
Modifier and TypeMethodDescriptionappend(char constant) Appends the givencharconstant to thisStringBuilder.Appends the string value of givenexprto thisStringBuilder.Appends the givenStringconstant to thisStringBuilder.appendCodePoint(int codePoint) Appends the given code point to thisStringBuilder.appendCodePoint(Expr codePoint) Appends the given code point to thisStringBuilder.Generate a call toComparable.compareTo(Object).voidsetLength(int length) Set the length of thisStringBuilder.voidSet the length of thisStringBuilder.Methods inherited from class io.quarkus.gizmo2.creator.ops.ObjectOps
blockCreator, equals_, getClass_, hashCode_, invokeInstance, invokeInstance, invokeInstance, invokeInstance, invokeInstance, receiver, receiverType, toString_
-
Constructor Details
-
StringBuilderOps
Construct a new instance on an existingStringBuilder.- Parameters:
bc- the block creator (must not benull)obj- the receiver string builder (must not benull)
-
StringBuilderOps
Construct a new instance on a newly createdStringBuilder.- Parameters:
bc- the block creator (must not benull)
-
StringBuilderOps
Construct a new instance on a newly createdStringBuilderwith givencapacity.- Parameters:
bc- the block creator (must not benull)capacity- the capacity of the newly createdStringBuilder
-
-
Method Details
-
append
Appends the string value of givenexprto thisStringBuilder.- Parameters:
expr- the value to append- Returns:
- this instance
-
append
Appends the givencharconstant to thisStringBuilder.- Parameters:
constant- the value to append- Returns:
- this instance
-
append
Appends the givenStringconstant to thisStringBuilder.- Parameters:
constant- the value to append- Returns:
- this instance
-
appendCodePoint
Appends the given code point to thisStringBuilder.- Parameters:
codePoint- the value to append (must not benull)- Returns:
- this instance
-
appendCodePoint
Appends the given code point to thisStringBuilder.- Parameters:
codePoint- the value to append- Returns:
- this instance
-
setLength
Set the length of thisStringBuilder.- Parameters:
length- the length expression (must not benull)
-
setLength
public void setLength(int length) Set the length of thisStringBuilder.- Parameters:
length- the constant length
-
compareTo
Description copied from interface:ComparableOpsGenerate a call toComparable.compareTo(Object).- Specified by:
compareToin interfaceComparableOps- Parameters:
other- the other object to compare (must not benull)- Returns:
- the expression of the result (not
null)
-