@Override public ImmutableMap<?, ?> convert(Object val, Multiplicity m) throws AtlasException { if (val != null) { Iterator<Map.Entry> it = null; if (Map.class.isAssignableFrom(val.getClass())) { it = ((Map) val).entrySet().iterator(); ImmutableMap.Builder b = ImmutableMap.builder(); while (it.hasNext()) { Map.Entry e = it.next(); b.put(keyType.convert(e.getKey(), TypeSystem.getInstance().allowNullsInCollections() ? Multiplicity.OPTIONAL : Multiplicity.REQUIRED), valueType.convert(e.getValue(), Multiplicity.OPTIONAL)); } return b.build(); } else { throw new ValueConversionException(this, val); } } if (!m.nullAllowed()) { throw new ValueConversionException.NullConversionException(m); } return null; }
@Override public ImmutableMap<?, ?> convert(Object val, Multiplicity m) throws AtlasException { if (val != null) { Iterator<Map.Entry> it = null; if (Map.class.isAssignableFrom(val.getClass())) { it = ((Map) val).entrySet().iterator(); ImmutableMap.Builder b = ImmutableMap.builder(); while (it.hasNext()) { Map.Entry e = it.next(); b.put(keyType.convert(e.getKey(), TypeSystem.getInstance().allowNullsInCollections() ? Multiplicity.OPTIONAL : Multiplicity.REQUIRED), valueType.convert(e.getValue(), Multiplicity.OPTIONAL)); } return b.build(); } else { throw new ValueConversionException(this, val); } } if (!m.nullAllowed()) { throw new ValueConversionException.NullConversionException(m); } return null; }
throw new ValueConversionException.NullConversionException(m);
throw new ValueConversionException.NullConversionException(i.multiplicity, String.format(" Value expected for required attribute %s", i.name)); } else { throw new ValueConversionException.NullConversionException(m);
throw new ValueConversionException.NullConversionException(i.multiplicity, String.format(" Value expected for required attribute %s", i.name)); } else { throw new ValueConversionException.NullConversionException(m);
cVal = i.dataType().convert(val, i.multiplicity); } catch(ValueConversionException.NullConversionException e) { throw new ValueConversionException.NullConversionException("For field '" + attrName + "'", e);
throw new ValueConversionException.NullConversionException(m);
cVal = i.dataType().convert(val, i.multiplicity); } catch(ValueConversionException.NullConversionException e) { throw new ValueConversionException.NullConversionException("For field '" + attrName + "'", e);
@Override protected T convertNull(Multiplicity m) throws AtlasException { if (!m.nullAllowed()) { throw new ValueConversionException.NullConversionException(m); } return nullValue(); }
@Override protected T convertNull(Multiplicity m) throws AtlasException { if (!m.nullAllowed()) { throw new ValueConversionException.NullConversionException(m); } return nullValue(); }
protected T convertNull(Multiplicity m) throws AtlasException { if (!m.nullAllowed()) { throw new ValueConversionException.NullConversionException(m); } return null; }
protected T convertNull(Multiplicity m) throws AtlasException { if (!m.nullAllowed()) { throw new ValueConversionException.NullConversionException(m); } return null; }