@Override public final CharSequence subSequence ( int start, int end ) { return new CharSequenceValue (false, type, start, end, buffer, decodeStrings, checkDate); }
@Override public String stringValueEncoded () { return decode(buffer, startIndex, endIndex); }
public String stringValue () { if ( this.decodeStrings ) { return decodeForSure(buffer, startIndex, endIndex); } else { return toString (); } }
return doubleValue (); return intValue () ; } else { return longValue () ; date = Dates.fromISO8601( buffer, startIndex, endIndex ); } else { return stringValue(); return stringValue (); } else { return date; return stringValue ();
@Override public <T extends Enum> T toEnum( Class<T> cls ) { switch ( type ) { case STRING: return Conversions.toEnum ( cls, stringValue () ); case INT: case INTEGER_WRAPPER: return Conversions.toEnum( cls, intValue() ); case NULL: return null; } Exceptions.die("toEnum " + cls + " value was " + stringValue()); return null; }
@Override public Date dateValue () { if ( type == TypeType.STRING ) { if ( Dates.isISO8601QuickCheck ( buffer, startIndex, endIndex ) ) { if ( Dates.isJsonDate ( buffer, startIndex, endIndex ) ) { return Dates.fromJsonDate ( buffer, startIndex, endIndex ); } else if ( Dates.isISO8601Jackson(buffer, startIndex, endIndex) ) { return Dates.fromISO8601Jackson(buffer, startIndex, endIndex); } else if ( Dates.isISO8601 ( buffer, startIndex, endIndex ) ) { return Dates.fromISO8601 ( buffer, startIndex, endIndex ); } else { throw new IllegalStateException( "Unable to convert " + stringValue () + " to date " ); } } else { throw new IllegalStateException ( "Unable to convert " + stringValue () + " to date " ); } } else { return new Date ( Dates.utc ( longValue () ) ); } }
@Override public boolean booleanValue() { return Boolean.parseBoolean ( toString () ); }
public short shortValue () { return ( short ) intValue (); }
public String toString () { if (this.decodeStrings) { return stringValue(); } else if ( startIndex == 0 && endIndex == buffer.length ) { return FastStringUtils.noCopyStringFromCharsNoCheck(buffer); } else { return new String ( buffer, startIndex, ( endIndex - startIndex ) ); } }
private static String decode( char[] chars, int start, int to ) { if ( !Chr.contains(chars, '\\', start, to - start) ) { return new String( chars, start, to - start ); } return decodeForSure( chars, start, to ); }
@Override public final Object toValue () { return value != null ? value : (value = doToValue ()) ; }
return doubleValue (); return intValue () ; } else { return longValue () ; date = Dates.fromISO8601( buffer, startIndex, endIndex ); } else { return stringValue(); return stringValue (); } else { return date; return stringValue ();
@Override public <T extends Enum> T toEnum( Class<T> cls ) { switch ( type ) { case STRING: return Conversions.toEnum ( cls, stringValue () ); case INT: case INTEGER_WRAPPER: return Conversions.toEnum( cls, intValue() ); case NULL: return null; } Exceptions.die("toEnum " + cls + " value was " + stringValue()); return null; }
@Override public Date dateValue () { if ( type == TypeType.STRING ) { if ( Dates.isISO8601QuickCheck ( buffer, startIndex, endIndex ) ) { if ( Dates.isJsonDate ( buffer, startIndex, endIndex ) ) { return Dates.fromJsonDate ( buffer, startIndex, endIndex ); } else if ( Dates.isISO8601Jackson(buffer, startIndex, endIndex) ) { return Dates.fromISO8601Jackson(buffer, startIndex, endIndex); } else if ( Dates.isISO8601 ( buffer, startIndex, endIndex ) ) { return Dates.fromISO8601 ( buffer, startIndex, endIndex ); } else { throw new IllegalStateException( "Unable to convert " + stringValue () + " to date " ); } } else { throw new IllegalStateException ( "Unable to convert " + stringValue () + " to date " ); } } else { return new Date ( Dates.utc ( longValue () ) ); } }
@Override public BigInteger bigIntegerValue() { return new BigInteger ( toString () ); }
public short shortValue () { return ( short ) intValue (); }
public String toString () { if (this.decodeStrings) { return stringValue(); } else if ( startIndex == 0 && endIndex == buffer.length ) { return FastStringUtils.noCopyStringFromCharsNoCheck(buffer); } else { return new String ( buffer, startIndex, ( endIndex - startIndex ) ); } }
private static String decode( char[] chars, int start, int to ) { if ( !Chr.contains(chars, '\\', start, to - start) ) { return new String( chars, start, to - start ); } return decodeForSure( chars, start, to ); }
@Override public final Object toValue () { return value != null ? value : (value = doToValue ()) ; }
@Override public final CharSequence subSequence ( int start, int end ) { return new CharSequenceValue (false, type, start, end, buffer, decodeStrings, checkDate); }