@Override public AtlasType getTypeForAttribute() { AtlasType keyAttributeType = keyType.getTypeForAttribute(); AtlasType valueAttributeType = valueType.getTypeForAttribute(); if (keyAttributeType == keyType && valueAttributeType == valueType) { return this; } else { AtlasType attributeType = new AtlasMapType(keyAttributeType, valueAttributeType); if (LOG.isDebugEnabled()) { LOG.debug("getTypeForAttribute(): {} ==> {}", getTypeName(), attributeType.getTypeName()); } return attributeType; } }
@Override public AtlasType getTypeForAttribute() { AtlasType keyAttributeType = keyType.getTypeForAttribute(); AtlasType valueAttributeType = valueType.getTypeForAttribute(); if (keyAttributeType == keyType && valueAttributeType == valueType) { return this; } else { AtlasType attributeType = new AtlasMapType(keyAttributeType, valueAttributeType); if (LOG.isDebugEnabled()) { LOG.debug("getTypeForAttribute(): {} ==> {}", getTypeName(), attributeType.getTypeName()); } return attributeType; } } }
@Override public AtlasType getTypeForAttribute() { AtlasType elementAttributeType = elementType.getTypeForAttribute(); if (elementAttributeType == elementType) { return this; } else { AtlasType attributeType = new AtlasArrayType(elementAttributeType, minCount, maxCount); if (LOG.isDebugEnabled()) { LOG.debug("getTypeForAttribute(): {} ==> {}", getTypeName(), attributeType.getTypeName()); } return attributeType; } }
@Override public AtlasType getTypeForAttribute() { AtlasType elementAttributeType = elementType.getTypeForAttribute(); if (elementAttributeType == elementType) { return this; } else { AtlasType attributeType = new AtlasArrayType(elementAttributeType, minCount, maxCount); if (LOG.isDebugEnabled()) { LOG.debug("getTypeForAttribute(): {} ==> {}", getTypeName(), attributeType.getTypeName()); } return attributeType; } }
public AtlasAttribute(AtlasStructType definedInType, AtlasAttributeDef attrDef, AtlasType attributeType, String relationshipLabel) { this.definedInType = definedInType; this.attributeDef = attrDef; this.attributeType = attributeType.getTypeForAttribute(); this.qualifiedName = getQualifiedAttributeName(definedInType.getStructDef(), attributeDef.getName()); this.vertexPropertyName = encodePropertyKey(this.qualifiedName); this.relationshipEdgeLabel = getRelationshipEdgeLabel(relationshipLabel); boolean isOwnedRef = false; String inverseRefAttribute = null; if (CollectionUtils.isNotEmpty(attributeDef.getConstraints())) { for (AtlasConstraintDef constraint : attributeDef.getConstraints()) { if (constraint.isConstraintType(CONSTRAINT_TYPE_OWNED_REF)) { isOwnedRef = true; } if (constraint.isConstraintType(CONSTRAINT_TYPE_INVERSE_REF)) { Object val = constraint.getParam(CONSTRAINT_PARAM_ATTRIBUTE); if (val != null) { inverseRefAttribute = val.toString(); } } } } this.isOwnedRef = isOwnedRef; this.inverseRefAttributeName = inverseRefAttribute; this.relationshipEdgeDirection = AtlasRelationshipEdgeDirection.OUT; }
public AtlasAttribute(AtlasStructType definedInType, AtlasAttributeDef attrDef, AtlasType attributeType, String relationshipLabel) { this.definedInType = definedInType; this.attributeDef = attrDef; this.attributeType = attributeType.getTypeForAttribute(); this.qualifiedName = getQualifiedAttributeName(definedInType.getStructDef(), attributeDef.getName()); this.vertexPropertyName = encodePropertyKey(this.qualifiedName); this.relationshipEdgeLabel = getRelationshipEdgeLabel(relationshipLabel); boolean isOwnedRef = false; String inverseRefAttribute = null; if (CollectionUtils.isNotEmpty(attributeDef.getConstraints())) { for (AtlasConstraintDef constraint : attributeDef.getConstraints()) { if (constraint.isConstraintType(CONSTRAINT_TYPE_OWNED_REF)) { isOwnedRef = true; } if (constraint.isConstraintType(CONSTRAINT_TYPE_INVERSE_REF)) { Object val = constraint.getParam(CONSTRAINT_PARAM_ATTRIBUTE); if (val != null) { inverseRefAttribute = val.toString(); } } } } this.isOwnedRef = isOwnedRef; this.inverseRefAttributeName = inverseRefAttribute; this.relationshipEdgeDirection = AtlasRelationshipEdgeDirection.OUT; }