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 ) ); } }
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 ) ); } }
@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 <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 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 () ) ); } }
date = Dates.fromISO8601( buffer, startIndex, endIndex ); } else { return stringValue(); return stringValue (); } else { return date; return stringValue ();
date = Dates.fromISO8601( buffer, startIndex, endIndex ); } else { return stringValue(); return stringValue (); } else { return date; return stringValue ();