public TypeUpdateException(IDataType newType, String message) { super(newType.getName() + " can't be updated - " + message); } }
public TypeUpdateException(IDataType newType, Exception e) { super(newType.getName() + " can't be updated - " + e.getMessage(), e); }
public ValueConversionException(IDataType typ, Object val, String msg) { super(String .format("Cannot convert value '%s' to datatype %s because: %s", val.toString(), typ.getName(), msg)); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; AttributeInfo that = (AttributeInfo) o; return isComposite == that.isComposite && isUnique == that.isUnique && isIndexable == that.isIndexable && Objects.equals(name, that.name) && Objects.equals(multiplicity, that.multiplicity) && Objects.equals(reverseAttributeName, that.reverseAttributeName) && dataType == null ? that.dataType == null : Objects.equals(dataType.getName(), that.dataType.getName()); }
@Override public void put(IDataType type) throws AtlasException { assertValidType(type); types_.put(type.getName(), type); }
@Override public void putAll(Collection<IDataType> types) throws AtlasException { for (IDataType type : types) { assertValidType(type); types_.put(type.getName(), type); } }
@Override public void put(IDataType type) throws AtlasException { assertValidType(type); types_.put(type.getName(), type); }
@Override public void putAll(Collection<IDataType> types) throws AtlasException { for (IDataType type : types) { assertValidType(type); types_.put(type.getName(), type); } }
/** * Validate that current definition can be updated with the new definition * @param newType */ @Override public void validateUpdate(IDataType newType) throws TypeUpdateException { if (!getName().equals(newType.getName()) || !getClass().getName().equals(newType.getClass().getName())) { throw new TypeUpdateException(newType); } }
/** * Validate that current definition can be updated with the new definition * @param newType */ @Override public void validateUpdate(IDataType newType) throws TypeUpdateException { if (!getName().equals(newType.getName()) || !getClass().getName().equals(newType.getClass().getName())) { throw new TypeUpdateException(newType); } }
public static AttributeInfo newAttributeInfo(String attribute, IDataType type) { try { return new AttributeInfo(ts, new AttributeDefinition(attribute, type.getName(), Multiplicity.REQUIRED, false, null), null); } catch (AtlasException e) { throw new RuntimeException(e); } }
private void verifyType(IDataType actualType, String expectedName, Class<? extends IDataType> typeClass) { assertNotNull(actualType, "The " + expectedName + " type not in cache"); assertTrue(typeClass.isInstance(actualType)); assertEquals(actualType.getName(), expectedName, "The type name does not match"); }
public static AttributeInfo newAttributeInfo(String attribute, IDataType type) { try { return new AttributeInfo(ts, new AttributeDefinition(attribute, type.getName(), Multiplicity.REQUIRED, false, null), null); } catch (AtlasException e) { throw new RuntimeException(e); } }
private void verifyType(IDataType actualType, String expectedName, Class<? extends IDataType> typeClass) { assertNotNull(actualType, "The " + expectedName + " type not in cache"); assertTrue(typeClass.isInstance(actualType)); assertEquals(actualType.getName(), expectedName, "The type name does not match"); }
private void setupRecursiveTypes() throws AtlasException { for (AttributeInfo info : recursiveRefs) { info.setDataType(dataType(info.dataType().getName())); } for (DataTypes.ArrayType arrType : recursiveArrayTypes) { arrType.setElemType(dataType(arrType.getElemType().getName())); } for (DataTypes.MapType mapType : recursiveMapTypes) { mapType.setKeyType(dataType(mapType.getKeyType().getName())); mapType.setValueType(dataType(mapType.getValueType().getName())); } }
private void setupRecursiveTypes() throws AtlasException { for (AttributeInfo info : recursiveRefs) { info.setDataType(dataType(info.dataType().getName())); } for (DataTypes.ArrayType arrType : recursiveArrayTypes) { arrType.setElemType(dataType(arrType.getElemType().getName())); } for (DataTypes.MapType mapType : recursiveMapTypes) { mapType.setKeyType(dataType(mapType.getKeyType().getName())); mapType.setValueType(dataType(mapType.getValueType().getName())); } }
public String toJson() throws JSONException { JSONObject json = new JSONObject(); json.put("name", name); json.put("multiplicity", multiplicity.toJson()); json.put("isComposite", isComposite); json.put("isUnique", isUnique); json.put("isIndexable", isIndexable); json.put("dataType", dataType.getName()); json.put("reverseAttributeName", reverseAttributeName); return json.toString(); }
public String toJson() throws JSONException { JSONObject json = new JSONObject(); json.put("name", name); json.put("multiplicity", multiplicity.toJson()); json.put("isComposite", isComposite); json.put("isUnique", isUnique); json.put("isIndexable", isIndexable); json.put("dataType", dataType.getName()); json.put("reverseAttributeName", reverseAttributeName); return json.toString(); }