private BCF2FieldEncoder( final VCFCompoundHeaderLine headerLine, final Map<String, Integer> dict, final BCF2Type staticType) { this.headerLine = headerLine; this.staticType = staticType; final Integer offset = dict.get(getField()); if (offset == null) throw new IllegalStateException( "Format error: could not find string " + getField() + " in header as required by BCF"); this.dictionaryOffset = offset; dictionaryOffsetType = BCF2Utils.determineIntegerType(offset); }
@Override public BCF2Type getDynamicType(final Object value) { return value == null ? BCF2Type.INT8 : BCF2Utils.determineIntegerType(BCF2Utils.toList(Integer.class, value)); }
@Override public BCF2Type getDynamicType(final Object value) { return value == null ? BCF2Type.INT8 : BCF2Utils.determineIntegerType((Integer) value); }