Class LazyString

java.lang.Object
com.mysql.cj.util.LazyString
All Implemented Interfaces:
java.util.function.Supplier<java.lang.String>

public class LazyString
extends java.lang.Object
implements java.util.function.Supplier<java.lang.String>
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).
  • Constructor Summary

    Constructors 
    Constructor Description
    LazyString​(byte[] buffer, int offset, int length)  
    LazyString​(byte[] buffer, int offset, int length, java.lang.String encoding)  
    LazyString​(java.lang.String string)  
  • Method Summary

    Modifier and Type Method Description
    java.lang.String get()  
    int length()  
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • LazyString

      public LazyString​(java.lang.String string)
    • LazyString

      public LazyString​(byte[] buffer, int offset, int length, java.lang.String encoding)
    • LazyString

      public LazyString​(byte[] buffer, int offset, int length)
  • Method Details

    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • length

      public int length()
    • get

      public java.lang.String get()
      Specified by:
      get in interface java.util.function.Supplier<java.lang.String>