UTF8StringPointable extends AbstractPointable implements IHashable, IComparable { public int getStringLength() { if (stringLength < 0) { stringLength = UTF8StringUtil.getStringLength(bytes, start); } return stringLength; }  static UTF8StringPointable generateUTF8Pointable(String string); char charAt(int offset); int charSize(int offset); int getStringLength(); int getUTF8Length(); int getMetaDataLength(); int getCharStartOffset(); @Override int compareTo(IPointable pointer); @Override int compareTo(byte[] bytes, int start, int length); @Override int hash(); void toString(StringBuilder buffer); @Override String toString(); int ignoreCaseCompareTo(UTF8StringPointable other); int find(UTF8StringPointable pattern, boolean ignoreCase); static int find(UTF8StringPointable src, UTF8StringPointable pattern, boolean ignoreCase); boolean contains(UTF8StringPointable pattern, boolean ignoreCase); static boolean contains(UTF8StringPointable src, UTF8StringPointable pattern, boolean ignoreCase); boolean startsWith(UTF8StringPointable pattern, boolean ignoreCase); static boolean startsWith(UTF8StringPointable src, UTF8StringPointable pattern, boolean ignoreCase); boolean endsWith(UTF8StringPointable pattern, boolean ignoreCase); static boolean endsWith(UTF8StringPointable src, UTF8StringPointable pattern, boolean ignoreCase); void concat(UTF8StringPointable next, UTF8StringBuilder builder, GrowableArray out); static void concat(UTF8StringPointable first, UTF8StringPointable next, UTF8StringBuilder builder,
            GrowableArray out); void substr(int charOffset, int charLength, UTF8StringBuilder builder, GrowableArray out); static void substr(UTF8StringPointable src, int charOffset, int charLength, UTF8StringBuilder builder,
            GrowableArray out); void substrBefore(UTF8StringPointable match, UTF8StringBuilder builder, GrowableArray out); static void substrBefore(UTF8StringPointable src, UTF8StringPointable match, UTF8StringBuilder builder,
            GrowableArray out); void substrAfter(UTF8StringPointable match, UTF8StringBuilder builder, GrowableArray out); static void substrAfter(UTF8StringPointable src, UTF8StringPointable match, UTF8StringBuilder builder,
            GrowableArray out); void lowercase(UTF8StringBuilder builder, GrowableArray out); static void lowercase(UTF8StringPointable src, UTF8StringBuilder builder, GrowableArray out); void uppercase(UTF8StringBuilder builder, GrowableArray out); static void uppercase(UTF8StringPointable src, UTF8StringBuilder builder, GrowableArray out); static final ITypeTraits TYPE_TRAITS; static final IPointableFactory FACTORY; }
@Test public void testGetStringLength() throws Exception { UTF8StringPointable utf8Ptr = UTF8StringPointable.generateUTF8Pointable(UTF8StringSample.STRING_LEN_127); assertEquals(127, utf8Ptr.getUTF8Length()); assertEquals(1, utf8Ptr.getMetaDataLength()); assertEquals(127, utf8Ptr.getStringLength()); byte[] bytes = UTF8StringUtil.writeStringToBytes(UTF8StringSample.STRING_LEN_128); utf8Ptr.set(bytes, 0, bytes.length); assertEquals(128, utf8Ptr.getUTF8Length()); assertEquals(2, utf8Ptr.getMetaDataLength()); assertEquals(128, utf8Ptr.getStringLength()); }