@Override public String convert(Object val, Multiplicity m) throws AtlasException { if (val != null && (!(val instanceof String) || StringUtils.isNotEmpty((CharSequence) val))) { return val.toString(); } if (m.nullAllowed() && val != null){ return val.toString(); } return convertNull(m); }
protected T convertNull(Multiplicity m) throws AtlasException { if (!m.nullAllowed()) { throw new ValueConversionException.NullConversionException(m); } return null; }
@Override public String convert(Object val, Multiplicity m) throws AtlasException { if (val != null && (!(val instanceof String) || StringUtils.isNotEmpty((CharSequence) val))) { return val.toString(); } if (m.nullAllowed() && val != null){ return val.toString(); } return convertNull(m); }
protected T convertNull(Multiplicity m) throws AtlasException { if (!m.nullAllowed()) { throw new ValueConversionException.NullConversionException(m); } return null; }
@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(); }
@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; }
if (!m.nullAllowed()) { throw new ValueConversionException.NullConversionException(m);
if (!m.nullAllowed()) { throw new ValueConversionException.NullConversionException(m);
if (!m.nullAllowed()) { throw new ValueConversionException.NullConversionException(m);
if (!m.nullAllowed()) { throw new ValueConversionException.NullConversionException(m);
if(!i.multiplicity.nullAllowed() && !s.getValuesMap().containsKey(attrKey)){ throw new ValueConversionException.NullConversionException(i.multiplicity, String.format(" Value expected for required attribute %s", i.name)); if (!m.nullAllowed()) { throw new ValueConversionException.NullConversionException(m);
if(!i.multiplicity.nullAllowed() && !s.getValuesMap().containsKey(attrKey)){ throw new ValueConversionException.NullConversionException(i.multiplicity, String.format(" Value expected for required attribute %s", i.name)); if (!m.nullAllowed()) { throw new ValueConversionException.NullConversionException(m);