Fluo Tour: Basic Data Types

Tour page 5 of 28

Fluo has a few simple POJOs that are used throughout the API. These classes are found in org.apache.fluo.api.data. All of these types are immutable. Except for Span, all of the types are Comparable and have hash code and equals implementations. These types work with Bytes and Java Strings. Internally, Fluo only works with bytes. All API methods that deal with String will convert back and forth to and from bytes using UTF-8.

Bytes is modeled after Java String. Its an immutable wrapper around byte[] like String is an immutable wrapper around char[]. To make building Bytes more efficient and easier, there is a reusable BytesBuilder that is modeled after StringBuilder. Call Bytes.builder() to create a new BytesBuilder.

< 5 / 28 >