public static PointValue fromMap( MapValue map ) { PointBuilder fields = new PointBuilder(); map.foreach( ( key, value ) -> fields.assign( key.toLowerCase(), value ) ); return fromInputFields( fields ); }
/** * Parses the given text into a PointValue. The information stated in the header is saved into the PointValue * unless it is overridden by the information in the text * * @param text the input text to be parsed into a PointValue * @param fieldsFromHeader must be a value obtained from {@link #parseHeaderInformation(CharSequence)} or null * @return a PointValue instance with information from the {@param fieldsFromHeader} and {@param text} */ public static PointValue parse( CharSequence text, CSVHeaderInformation fieldsFromHeader ) { PointBuilder fieldsFromData = parseHeaderInformation( text ); if ( fieldsFromHeader != null ) { // Merge InputFields: Data fields override header fields if ( !(fieldsFromHeader instanceof PointBuilder) ) { throw new IllegalStateException( "Wrong header information type: " + fieldsFromHeader ); } fieldsFromData.mergeWithHeader( (PointBuilder) fieldsFromHeader ); } return fromInputFields( fieldsFromData ); }
/** * Parses the given text into a PointValue. The information stated in the header is saved into the PointValue * unless it is overridden by the information in the text * * @param text the input text to be parsed into a PointValue * @param fieldsFromHeader must be a value obtained from {@link #parseHeaderInformation(CharSequence)} or null * @return a PointValue instance with information from the {@param fieldsFromHeader} and {@param text} */ public static PointValue parse( CharSequence text, CSVHeaderInformation fieldsFromHeader ) { PointBuilder fieldsFromData = parseHeaderInformation( text ); if ( fieldsFromHeader != null ) { // Merge InputFields: Data fields override header fields if ( !(fieldsFromHeader instanceof PointBuilder) ) { throw new IllegalStateException( "Wrong header information type: " + fieldsFromHeader ); } fieldsFromData.mergeWithHeader( (PointBuilder) fieldsFromHeader ); } return fromInputFields( fieldsFromData ); }
public static PointValue fromMap( MapValue map ) { PointBuilder fields = new PointBuilder(); map.foreach( ( key, value ) -> fields.assign( key.toLowerCase(), value ) ); return fromInputFields( fields ); }