Class TsonUtils
java.lang.Object
net.thevpc.tson.impl.util.TsonUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final char[]static final TsonAnnotation[]static final TsonElement[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Comparable<T>>
intcompare(T a1, T a2) static <T extends Comparable<T>>
intcompareArrays(T[] a1, T[] a2) static intcompareElementsArray(List<TsonElement> a1, List<TsonElement> a2) static intcompareElementsArray(TsonArray[] a1, TsonArray[] a2) static intcompareElementsArray(TsonElement[] a1, TsonElement[] a2) static intstatic <T extends Comparable<T>>
intcompareLists(List<T> a1, List<T> a2) static DateconvertToDate(Instant dateToConvert) static DateconvertToDate(LocalDate dateToConvert) static DateconvertToDate(LocalDateTime dateToConvert) static DateconvertToSqlDate(LocalDate dateToConvert) static TimeconvertToSqlTime(LocalTime dateToConvert) static TsonElementdecorate(TsonElement element, TsonComments comments, List<TsonAnnotation> annotations) static TsonElementListstatic TsonElementListstatic StringescapeString(String str, char escape) static StringformatMultiLineComments(String str, boolean compact) static Stringstatic Stringstatic booleanstatic boolean/ int bestLen = len * 2 + 2; / if (bestLen < 0) { / bestLen = Integer.MAX_VALUE; / } / sb.ensureNext(sb.length()+bestLen + 2); / sb.ensureCapacity(sb.length()+bestLen + 2);static StringnullIfBlank(String name) static TsonElementsetAnnotations(TsonElement e, TsonAnnotation[] annotations) static TsonElementsetComments(TsonElement e, TsonComments comments) static TsonArraytoArray(List<TsonElement> elements) static TsonArraytoArray(TsonElementList elements) static Stringstatic voidstatic Stringstatic StringtoSmpStr(char str) static Stringstatic Stringstatic StringtrimToNull(String string) static UnmodifiableArrayList<TsonArray> unmodifiableArrays(List<TsonArray> all) static UnmodifiableArrayList<TsonElement>
-
Field Details
-
TSON_ANNOTATIONS_EMPTY_ARRAY
-
TSON_ELEMENTS_EMPTY_ARRAY
-
hexDigit
public static final char[] hexDigit
-
-
Constructor Details
-
TsonUtils
public TsonUtils()
-
-
Method Details
-
compareArrays
-
compareLists
-
decorate
public static TsonElement decorate(TsonElement element, TsonComments comments, List<TsonAnnotation> annotations) -
setComments
-
setAnnotations
-
indent
-
formatMultiLineComments
-
formatSingleLineComments
-
toRegex
-
toSmpStr
-
toSmpStr
-
escapeString
-
toDblStr
-
toDblStr
-
isValidIdentifier
/ int bestLen = len * 2 + 2; / if (bestLen < 0) { / bestLen = Integer.MAX_VALUE; / } / sb.ensureNext(sb.length()+bestLen + 2); / sb.ensureCapacity(sb.length()+bestLen + 2); -
isBlank
-
trim
-
trimToNull
-
compare
-
compareElementsArray
-
compareElementsArray
-
compareElementsArray
-
compareElementsArray
-
convertToDate
-
convertToSqlDate
-
convertToSqlTime
-
convertToDate
-
convertToDate
-
nullIfBlank
-
elementsListBaseOrNull
-
elementsListOrNull
-
unmodifiableElements
-
unmodifiableArrays
-
toArray
-
lines
-
toArray
-