Top Description Fields Constructors Methods
com.mysql.cj.util

public Class LazyString

extends Object
implements Supplier<String>
Class Inheritance
All Implemented Interfaces
java.util.function.Supplier
Imports
java.util.function.Supplier

A lazy string that can take a byte buffer and encoding and interpret it as a string if/when requested. The string is cached and saved for any further requests. "NULL" values can be represented by a 0-len string or a null passed to LazyString(String).

Field Summary

Modifier and TypeField and Description
private byte[]
private String
private int
private int
private String

Constructor Summary

AccessConstructor and Description
public
public
LazyString(byte[] buffer, int offset, int length, String encoding)

public
LazyString(byte[] buffer, int offset, int length)

Method Summary

Modifier and TypeMethod and Description
private String
public String
get()

Implements java.util.function.Supplier.get.

Gets a result.

public int
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

bufferback to summary
private byte[] buffer
encodingback to summary
private String encoding
lengthback to summary
private int length
offsetback to summary
private int offset
stringback to summary
private String string

Constructor Detail

LazyStringback to summary
public LazyString(String string)
LazyStringback to summary
public LazyString(byte[] buffer, int offset, int length, String encoding)
LazyStringback to summary
public LazyString(byte[] buffer, int offset, int length)

Method Detail

createAndCacheStringback to summary
private String createAndCacheString()
getback to summary
public String get()

Implements java.util.function.Supplier.get.

Doc from java.util.function.Supplier.get.

Gets a result.

Returns:String

a result

Annotations
@Override
lengthback to summary
public int length()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override