public final class StringBuilders extends Object
Modifier and Type | Method and Description |
---|---|
static StringBuilder |
appendDqValue(StringBuilder sb,
Object value)
Appends in the following format: double quoted value.
|
static StringBuilder |
appendKeyDqValue(StringBuilder sb,
Map.Entry<String,String> entry)
Appends in the following format: key=double quoted value.
|
static StringBuilder |
appendKeyDqValue(StringBuilder sb,
String key,
Object value)
Appends in the following format: key=double quoted value.
|
static boolean |
appendSpecificTypes(StringBuilder stringBuilder,
Object obj) |
static void |
appendValue(StringBuilder stringBuilder,
Object obj)
Appends a text representation of the specified object to the specified StringBuilder,
if possible without allocating temporary objects.
|
static boolean |
equals(CharSequence left,
int leftOffset,
int leftLength,
CharSequence right,
int rightOffset,
int rightLength)
Returns true if the specified section of the left CharSequence equals the specified section of the right
CharSequence.
|
static boolean |
equalsIgnoreCase(CharSequence left,
int leftOffset,
int leftLength,
CharSequence right,
int rightOffset,
int rightLength)
Returns true if the specified section of the left CharSequence equals, ignoring case, the specified section of
the right CharSequence.
|
static void |
escapeJson(StringBuilder toAppendTo,
int start) |
static void |
escapeXml(StringBuilder toAppendTo,
int start) |
static void |
trimToMaxSize(StringBuilder stringBuilder,
int maxSize)
Ensures that the char[] array of the specified StringBuilder does not exceed the specified number of characters.
|
public static StringBuilder appendDqValue(StringBuilder sb, Object value)
sb
- a string buildervalue
- a value"value"
public static StringBuilder appendKeyDqValue(StringBuilder sb, Map.Entry<String,String> entry)
sb
- a string builderentry
- a map entrykey="value"
public static StringBuilder appendKeyDqValue(StringBuilder sb, String key, Object value)
sb
- a string builderkey
- a keyvalue
- a valuepublic static void appendValue(StringBuilder stringBuilder, Object obj)
stringBuilder
- the StringBuilder to append the value toobj
- the object whose text representation to append to the StringBuilderpublic static boolean appendSpecificTypes(StringBuilder stringBuilder, Object obj)
public static boolean equals(CharSequence left, int leftOffset, int leftLength, CharSequence right, int rightOffset, int rightLength)
left
- the left CharSequenceleftOffset
- start index in the left CharSequenceleftLength
- length of the section in the left CharSequenceright
- the right CharSequence to compare a section ofrightOffset
- start index in the right CharSequencerightLength
- length of the section in the right CharSequencepublic static boolean equalsIgnoreCase(CharSequence left, int leftOffset, int leftLength, CharSequence right, int rightOffset, int rightLength)
left
- the left CharSequenceleftOffset
- start index in the left CharSequenceleftLength
- length of the section in the left CharSequenceright
- the right CharSequence to compare a section ofrightOffset
- start index in the right CharSequencerightLength
- length of the section in the right CharSequencepublic static void trimToMaxSize(StringBuilder stringBuilder, int maxSize)
stringBuilder
- the StringBuilder to checkmaxSize
- the maximum number of characters the StringBuilder is allowed to havepublic static void escapeJson(StringBuilder toAppendTo, int start)
public static void escapeXml(StringBuilder toAppendTo, int start)
Copyright © 1999-1969 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.