@Override public boolean isValidValue(Object obj) { boolean ret = true; if (obj != null) { if (obj instanceof AtlasRelationshipType) { validateAtlasRelationshipType((AtlasRelationshipType) obj); } ret = super.isValidValue(obj); } return ret; }
@Override public boolean isValidValue(Object obj) { if (obj != null) { for (AtlasClassificationType superType : superTypes) { if (!superType.isValidValue(obj)) { return false; } } return super.isValidValue(obj); } return true; }
@Override public boolean isValidValue(Object obj) { if (obj != null) { for (AtlasEntityType superType : superTypes) { if (!superType.isValidValue(obj)) { return false; } } return super.isValidValue(obj); } return true; }
@Test public void testStructTypeIsValidValue() { for (Object value : validValues) { assertTrue(structType.isValidValue(value), "value=" + value); } for (Object value : invalidValues) { assertFalse(structType.isValidValue(value), "value=" + value); } }
@Test public void testStructTypeIsValidValue() { for (Object value : validValues) { assertTrue(structType.isValidValue(value), "value=" + value); } for (Object value : invalidValues) { assertFalse(structType.isValidValue(value), "value=" + value); } }
@Override public boolean isValidValue(Object obj) { if (obj != null) { for (AtlasEntityType superType : superTypes) { if (!superType.isValidValue(obj)) { return false; } } return super.isValidValue(obj) && validateRelationshipAttributes(obj); } return true; }
@Override public boolean isValidValue(Object obj) { if (obj != null) { for (AtlasClassificationType superType : superTypes) { if (!superType.isValidValue(obj)) { return false; } } if (!validateTimeBoundaries(obj, null)) { return false; } return super.isValidValue(obj); } return true; }
@Override public Object getNormalizedValue(Object obj) { Object ret = null; if (obj != null) { if (isValidValue(obj)) { if (obj instanceof AtlasStruct) { normalizeAttributeValues((AtlasStruct) obj); ret = obj; } else if (obj instanceof Map) { normalizeAttributeValues((Map) obj); ret = obj; } } } return ret; }
@Override public Object getNormalizedValue(Object obj) { Object ret = null; if (obj != null) { if (isValidValue(obj)) { if (obj instanceof AtlasStruct) { normalizeAttributeValues((AtlasStruct) obj); ret = obj; } else if (obj instanceof Map) { normalizeAttributeValues((Map) obj); ret = obj; } } } return ret; }
/** * Validate the fields in the the RelationshipType are consistent with respect to themselves. * @param relationship * @throws AtlasBaseException */ private boolean validateRelationship(AtlasRelationship relationship) { String end1TypeName = relationship.getEnd1() != null ? relationship.getEnd1().getTypeName() : null; String end2TypeName = relationship.getEnd2() != null ? relationship.getEnd2().getTypeName() : null; if (StringUtils.isNotEmpty(end1TypeName) && StringUtils.isNotEmpty(end2TypeName)) { return end1Type.isTypeOrSuperTypeOf(end1TypeName) && end2Type.isTypeOrSuperTypeOf(end2TypeName) && super.isValidValue(relationship); } return false; }