Constraint info from ConstraintDefinition for relationships

@param constraintDefinition
@return
555326
private ConstraintRelationshipInfo relationshipInfoFromConstraintDefinition(ConstraintDefinition constraintDefinition) {
        return new ConstraintRelationshipInfo(
                String.format("CONSTRAINT %s", constraintDefinition.toString()),
                constraintDefinition.getConstraintType().name(),
                Iterables.asList(constraintDefinition.getPropertyKeys()),
                ""
        );
    }
673261
public void addConstraint( final FieldConstraint constraint ) {
        if ( constraintList == null ) {
            constraintList = new CompositeFieldConstraint();
        }
        this.constraintList.addConstraint( constraint );
    }
135054
public static <T> Mapping<List<T>> list(Mapping<T> base, Constraint... constraints) {
        String mname = "list of " + base.meta().name;
        return new FieldMapping<>(
                InputMode.MULTIPLE,
                ((name, data) -> {
                    logger.debug("list - converting {}", name);

                    return indexes(name, data).stream()
                            .map(i -> base.convert(name + "[" + i + "]", data))
                            .collect(Collectors.toList());
                }),
                ((name, data, messages, options) -> {
                    logger.debug("list - validating {}", name);

                    return indexes(name, data).stream()
                            .flatMap(i -> base.validate(name + "[" + i + "]", data, messages, options).stream())
                            .collect(Collectors.toList());
                }), new MappingMeta(mname, List.class, base)
            ).constraint(constraints);
        }
740525
int getConstraintIndex(String constraintName) {

        for (int i = 0, size = constraintList.length; i < size; i++) {
            if (constraintList[i].getName().name.equals(constraintName)) {
                return i;
            }
        }

        return -1;
    }
99076
public final void setConstraint(@NonNull final Constraint<Type> constraint) {
        Condition.INSTANCE.ensureNotNull(constraint, "The constraint may not be null");
        this.constraint = constraint;
    }
473744
public final void setConstraints(@NonNull final Constraint<Type>[] constraints) {
        Condition.INSTANCE.ensureNotNull(constraints, "The constraints may not be null");
        Condition.INSTANCE.ensureAtLeast(constraints.length, 1, "The constraints may not be empty");
        this.constraints = constraints;
    }
1325654
private boolean checkConstraint(Collection<String> constraints, Tile tile)
    {
        return tile != null
               && constraints.contains(mapGroup.getGroup(tile))
               && !tile.getFeature(TileCollision.class).getCollisionFormulas().isEmpty();
    }
511370
private Stream<ConstraintRelationshipInfo> constraintsForRelationship(Map<String,Object> config) {
        Schema schema = db.schema();

        SchemaConfig schemaConfig = new SchemaConfig(config);
        Set<String> includeRelationships = schemaConfig.getRelationships();
        Set<String> excludeRelationships = schemaConfig.getExcludeRelationships();

        try ( Statement ignore = tx.acquireStatement() ) {
            TokenRead tokenRead = tx.tokenRead();
            Iterable<ConstraintDefinition> constraintsIterator;

            if(!includeRelationships.isEmpty()) {
                constraintsIterator = includeRelationships.stream()
                        .filter(type -> !excludeRelationships.contains(type) && tokenRead.relationshipType(type) != -1)
                        .flatMap(type -> {
                            Iterable<ConstraintDefinition> constraintsForType = schema.getConstraints(RelationshipType.withName(type));
                            return StreamSupport.stream(constraintsForType.spliterator(), false);
                        })
                        .collect(Collectors.toList());
            } else {
                Iterable<ConstraintDefinition> allConstraints = schema.getConstraints();
                constraintsIterator = StreamSupport.stream(allConstraints.spliterator(),false)
                        .filter(index -> !excludeRelationships.contains(index.getRelationshipType().name()))
                        .collect(Collectors.toList());
            }

            Stream<ConstraintRelationshipInfo> constraintRelationshipInfoStream = StreamSupport.stream(constraintsIterator.spliterator(), false)
                    .filter(constraintDefinition -> constraintDefinition.isConstraintType(ConstraintType.RELATIONSHIP_PROPERTY_EXISTENCE))
                    .map(this::relationshipInfoFromConstraintDefinition);

            return constraintRelationshipInfoStream;
        }
    }
5910
public List<ConstraintType<ParameterType<T>>> getAllConstraint()
   {
      List<ConstraintType<ParameterType<T>>> list = new ArrayList<ConstraintType<ParameterType<T>>>();
      List<Node> nodeList = childNode.get("constraint");
      for(Node node: nodeList)
      {
         ConstraintType<ParameterType<T>>  type = new ConstraintTypeImpl<ParameterType<T>>(this, "constraint", childNode, node);
         list.add(type);
      }
      return list;
   }
391639
public void removeConstraint( final int idx ) {
        //If the constraint being is a parent of another correct the other constraint's parent accordingly
        FieldConstraint constraintToRemove = this.constraints[ idx ];
        if ( constraintToRemove instanceof SingleFieldConstraint ) {
            final SingleFieldConstraint sfc = (SingleFieldConstraint) constraintToRemove;
            FieldConstraint parent = sfc.getParent();
            for ( FieldConstraint child : this.constraints ) {
                if ( child instanceof SingleFieldConstraint ) {
                    SingleFieldConstraint sfcChild = (SingleFieldConstraint) child;
                    if ( sfcChild.getParent() == constraintToRemove ) {
                        sfcChild.setParent( parent );
                        break;
                    }
                }
            }
        }
        final FieldConstraint[] newList = new FieldConstraint[ this.constraints.length - 1 ];
        int newIdx = 0;
        for ( int i = 0; i < this.constraints.length; i++ ) {

            if ( i != idx ) {
                newList[ newIdx ] = this.constraints[ i ];
                newIdx++;
            }

        }
        this.constraints = newList;

    }
242974
public Rules add(PropertyConstraint constraint) {
		CompoundPropertyConstraint and = (CompoundPropertyConstraint)propertiesConstraints.get(constraint
				.getPropertyName());
		if (and == null) {
			putPropertyConstraint(constraint);
		}
		else {
			and.add(constraint);
		}
		return this;
	}
748915
private IndexConstraintNodeInfo nodeInfoFromConstraintDescriptor(ConstraintDescriptor constraintDescriptor, TokenNameLookup tokens) {
        String labelName =  tokens.labelGetName(constraintDescriptor.schema().keyId());
        List<String> properties = new ArrayList<>();
        Arrays.stream(constraintDescriptor.schema().getPropertyIds()).forEach((i) -> properties.add(tokens.propertyKeyGetName(i)));
        return new IndexConstraintNodeInfo(
                // Pretty print for index name
                String.format(":%s(%s)", labelName, StringUtils.join(properties, ",")),
                labelName,
                properties,
                StringUtils.EMPTY,
                ConstraintType.NODE_PROPERTY_EXISTENCE.toString(),
                "NO FAILURE",
                0,
                0,
                0,
                constraintDescriptor.userDescription(tokens)
        );
    }
587144
public final Set<ConstraintViolation<Object>> getConstraintViolations() {
        if (constraintViolations == null) {
            return null;
        }
        return Collections.unmodifiableSet(constraintViolations);
    }
1053442
private Boolean constraintsExistsForRelationship(String type, List<String> propertyNames) {
        Schema schema = db.schema();

        for (ConstraintDefinition constraintDefinition : Iterables.asList(schema.getConstraints(RelationshipType.withName(type)))) {
            List<String> properties = Iterables.asList(constraintDefinition.getPropertyKeys());

            if (properties.equals(propertyNames)) {
                return true;
            }
        }

        return false;
    }
737482
public java.util.List<org.tensorflow.framework.KernelDef.AttrConstraint> getConstraintList() {
    return constraint_;
  }
220834
public void process() throws ConstraintException
    {
        ClassDescriptorDef otherClassDef;
        
        for (Iterator it = getDirectBaseTypes(); it.hasNext();)
        {
            otherClassDef = (ClassDescriptorDef)it.next();
            if (!otherClassDef.hasBeenProcessed())
            {
                otherClassDef.process();
            }
        }
        for (Iterator it = getNested(); it.hasNext();)
        {
            otherClassDef = ((NestedDef)it.next()).getNestedType();
            if (!otherClassDef.hasBeenProcessed())
            {
                otherClassDef.process();
            }
        }
        
        ArrayList               newFields      = new ArrayList();
        ArrayList               newReferences  = new ArrayList();
        ArrayList               newCollections = new ArrayList();
        FieldDescriptorDef      newFieldDef;
        ReferenceDescriptorDef  newRefDef;
        CollectionDescriptorDef newCollDef;
        
        // adding base features
        if (getBooleanProperty(PropertyHelper.OJB_PROPERTY_INCLUDE_INHERITED, true))
        {
            ArrayList baseTypes = new ArrayList();
            DefBase   featureDef;
            
            addRelevantBaseTypes(this, baseTypes);
            for (Iterator it = baseTypes.iterator(); it.hasNext();)
            {
                cloneInheritedFeatures((ClassDescriptorDef)it.next(), newFields, newReferences, newCollections);
            }

            for (Iterator it = newFields.iterator(); it.hasNext();)
            {
                newFieldDef = (FieldDescriptorDef)it.next();
                featureDef  = getFeature(newFieldDef.getName());
                if (featureDef != null)
                {    
                    if (!getBooleanProperty(PropertyHelper.OJB_PROPERTY_IGNORE, false))
                    {
                        // we have the implicit constraint that an anonymous field cannot redefine/be redefined
                        // except if it is ignored
                        if ("anonymous".equals(featureDef.getProperty(PropertyHelper.OJB_PROPERTY_ACCESS)))
                        {
                            throw new ConstraintException("The anonymous field "+featureDef.getName()+" in class "+getName()+" overrides an inherited field");
                        }
                        if ("anonymous".equals(newFieldDef.getProperty(PropertyHelper.OJB_PROPERTY_ACCESS)))
                        {
                            throw new ConstraintException("The inherited anonymous field "+newFieldDef.getName()+" is overriden in class "+getName());
                        }
                    }
                    LogHelper.warn(true, ClassDescriptorDef.class, "process", "Class "+getName()+" redefines the inherited field "+newFieldDef.getName());
                    it.remove();
                }
            }
            for (Iterator it = newReferences.iterator(); it.hasNext();)
            {
                newRefDef = (ReferenceDescriptorDef)it.next();
                if ("super".equals(newRefDef.getName()))
                {
                    // we don't inherit super-references
                    it.remove();
                }
                else if (hasFeature(newRefDef.getName()))
                {
                    LogHelper.warn(true, ClassDescriptorDef.class, "process", "Class "+getName()+" redefines the inherited reference "+newRefDef.getName());
                    it.remove();
                }
            }
            for (Iterator it = newCollections.iterator(); it.hasNext();)
            {
                newCollDef = (CollectionDescriptorDef)it.next();
                if (hasFeature(newCollDef.getName()))
                {
                    LogHelper.warn(true, ClassDescriptorDef.class, "process", "Class "+getName()+" redefines the inherited collection "+newCollDef.getName());
                    it.remove();
                }
            }
        }
        // adding nested features
        for (Iterator it = getNested(); it.hasNext();)
        {
            cloneNestedFeatures((NestedDef)it.next(), newFields, newReferences, newCollections);
        }
        _fields.addAll(0, newFields);
        _references.addAll(0, newReferences);
        _collections.addAll(0, newCollections);
        sortFields();
        _hasBeenProcessed = true;
    }
1223168
private void addConstraintNameToList(String constraintName) {
		validateStringValue(constraintName);
		Set<String> currentValues = getConstraintNameList();
		currentValues.add(constraintName);
		setProperty(ConstraintContextProperty.ALL_CONSTRAINTS, ArrayUtils.toString(currentValues.toArray()));
	}