Validates this metadata to ensure there are no duplicate property names defined in this
entity/embedded objects.
181908
public void ensureUniqueProperties() {
    masterPropertyMetadataMap.clear();
    for (PropertyMetadata propertyMetadata : getPropertyMetadataCollection()) {
      updateMasterPropertyMetadataMap(propertyMetadata.getMappedName(), propertyMetadata.getName());
    }
    // top level embedded objects
    for (EmbeddedMetadata embeddedMetadata : getEmbeddedMetadataCollection()) {
      ensureUniqueProperties(embeddedMetadata, embeddedMetadata.getStorageStrategy());
    }
  }
203918
public boolean validateNodeType()
   {

      boolean hasValidated = false;

      if (primaryItemName != null)
      {
         if (primaryItemName.length() <= 0)
         {
            primaryItemName = null;
            hasValidated = true;
         }
      }

      if (declaredSupertypeNames == null)
      {
         declaredSupertypeNames = new ArrayList<String>();
         hasValidated = true;
      }
      else
      {
         int prevSize = declaredSupertypeNames.size();
         fixStringsList(declaredSupertypeNames);
         hasValidated = prevSize != declaredSupertypeNames.size();
      }

      if (declaredPropertyDefinitionValues == null)
      {
         declaredPropertyDefinitionValues = new ArrayList<PropertyDefinitionValue>();
         hasValidated = true;
      }
      else
      {
         int prevSize = declaredPropertyDefinitionValues.size();
         fixPropertyDefinitionValuesList(declaredPropertyDefinitionValues);
         hasValidated = prevSize != declaredPropertyDefinitionValues.size();
      }

      if (declaredChildNodeDefinitionValues == null)
      {
         declaredChildNodeDefinitionValues = new ArrayList<NodeDefinitionValue>();
         hasValidated = true;
      }
      else
      {
         int prevSize = declaredChildNodeDefinitionValues.size();
         fixNodeDefinitionValuesList(declaredChildNodeDefinitionValues);
         hasValidated = prevSize != declaredChildNodeDefinitionValues.size();
      }

      return hasValidated;
   }
1270464
public void validate() {

		ErrorDetails details = null;
		if( this.fileName != null )
			details = ErrorDetails.file( this.fileName );

		if( this.failed ) {
			this.errors.add( new ModelError( ErrorCode.REC_TARGET_INVALID_FILE_OR_CONTENT, this.modelObject, details ));

		} else {
			String id = this.props.getProperty( Constants.TARGET_PROPERTY_ID );
			if( Utils.isEmptyOrWhitespaces( id ))
				this.errors.add( new ModelError( ErrorCode.REC_TARGET_NO_ID, this.modelObject, details ));

			String handler = this.props.getProperty( Constants.TARGET_PROPERTY_HANDLER );
			if( Utils.isEmptyOrWhitespaces( handler ))
				this.errors.add( new ModelError( ErrorCode.REC_TARGET_NO_HANDLER, this.modelObject, details ));

			String name = this.props.getProperty( Constants.TARGET_PROPERTY_NAME );
			if( Utils.isEmptyOrWhitespaces( name ))
				this.errors.add( new ModelError( ErrorCode.REC_TARGET_NO_NAME, this.modelObject, details ));
		}
	}
1025805
def _arevalid(self, datatype):
        ''''''
        # Datatype not specified
        if datatype not in self.meta:
            return datatype in Dap._optional_meta, []

        # Required datatype empty
        if datatype in self._required_meta and not self.meta[datatype]:
            return False, []

        # Datatype not a list
        if not isinstance(self.meta[datatype], list):
            return False, []

        # Duplicates found
        duplicates = set([x for x in self.meta[datatype] if self.meta[datatype].count(x) > 1])
        if duplicates:
            return False, list(duplicates)

        if datatype in self._badmeta:
            return False, self._badmeta[datatype]
        else:
            return True, []

        # Checking if all items are valid
        bad = []
        for item in self.meta[datatype]:
            if not Dap._meta_valid[datatype].match(item):
                bad.append(item)
        return len(bad) == 0, bad
484369
private void validateSubEntities(Entity obj) {
        // Validate that all sub entities have a "rel" set.
        String relRequired = "Sub entities are required to have a <rel> property set.";
        String hrefReqForEmbed = "Sub entities that are embedded links are required to have a <href> property set.";
        if (!CollectionUtils.isEmpty(obj.getEntities())) {
            for (Entity e : obj.getEntities()) {
                if (e.getRel() == null || ArrayUtils.isEmpty(e.getRel())) {
                    throw new Siren4JBuilderValidationException("entities", obj.getClass(), relRequired);
                }
                if ((e instanceof EmbeddedEntityImpl) && StringUtils.isBlank(e.getHref())) {
                    throw new Siren4JBuilderValidationException("entities", obj.getClass(), hrefReqForEmbed);
                }
            }
        }
    }
969689
public static void validateAllOrNone(Props props, String... keys) {
    Objects.requireNonNull(keys);

    boolean allExist = true;
    boolean someExist = false;
    for (String key : keys) {
      Object val = props.get(key);
      allExist &= val != null;
      someExist |= val != null;
    }

    if (someExist && !allExist) {
      throw new IllegalArgumentException(
          "Either all of properties exist or none of them should exist for " + Arrays
              .toString(keys));
    }
  }
819673
def validate(self, data):
        '''
        
        '''
        for prop in self.properties:
            if prop.id in data:
                if prop.type == 'string':
                    if not isinstance(data[prop.id], basestring):
                        raise PresetFieldTypeException("property '{}' must be of type string".format(prop.id))
                elif prop.type == 'enum':
                    if not isinstance(data[prop.id], basestring):
                        raise PresetFieldTypeException("property '{}' must be of type string".format(prop.id))
                    if data[prop.id] not in prop.values:
                        raise PresetException("property '{}' can be one of {}".format(prop.id, prop.values))
            else:
                if prop.required:
                    raise PresetMissingFieldException("missing required property: '{}'".format(prop.id))
1307418
public void validate(CFMetaData metadata) {
        for (Map.Entry<String, ColumnMapper> entry : columnMappers.entrySet()) {

            String name = entry.getKey();
            ColumnMapper columnMapper = entry.getValue();
            ByteBuffer columnName = UTF8Type.instance.decompose(name);

            ColumnDefinition columnDefinition = metadata.getColumnDefinition(columnName);
            if (columnDefinition == null) {
                throw new RuntimeException("No column definition for mapper " + name);
            }

            if (columnDefinition.isStatic()) {
                throw new RuntimeException("Lucene indexes are not allowed on static columns as " + name);
            }

            AbstractType<?> type = columnDefinition.type;
            if (!columnMapper.supports(type)) {
                throw new RuntimeException(String.format("Type '%s' is not supported by mapper '%s'", type, name));
            }
        }
    }
1090087
private <X extends Class, T extends Object> void validateEntityAttributes(Object entity,
            KunderaMetadata kunderaMetadata)
    {

        EntityMetadata entityMetadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata, entity.getClass());

        MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
                entityMetadata.getPersistenceUnit());
        AbstractManagedType managedType = (AbstractManagedType) metaModel.entity(entityMetadata.getEntityClazz());

        MetaModelBuilder<X, T> metaModelBuilder = kunderaMetadata.getApplicationMetadata().getMetaModelBuilder(
                entityMetadata.getPersistenceUnit());
        EntityType entityType = (EntityType) metaModelBuilder.getManagedTypes().get(entityMetadata.getEntityClazz());

        



        // if managed type has any validation constraint present then validate
        // the attributes
       
        if (managedType.hasValidationConstraints())
        {
          
            Set<Attribute> attributes = entityType.getAttributes();
            Iterator<Attribute> iter = attributes.iterator();

            while (iter.hasNext())
            {
                Attribute attribute = iter.next();
               
                Field f = (Field) ((Field) attribute.getJavaMember());
                
                //check if an embeddable field has a constraint
                if (metaModel.isEmbeddable(attribute.getJavaType()))
                {
                   
                    EmbeddableType embeddedColumn = (EmbeddableType) metaModelBuilder.getEmbeddables().get(attribute.getJavaType());
                    Object embeddedObject = PropertyAccessorHelper.getObject(entity,
                            (Field) entityType.getAttribute(attribute.getName()).getJavaMember());
                    
                    onValidateEmbeddable(embeddedObject, embeddedColumn);
                }
                this.factory.validate(f, entity, new AttributeConstraintRule());

            }

        }

    }
1027718
@Override
    public void validate() {

        if (entityClass == null) {
            throw new IllegalArgumentException("testentity class cannot be null");
        }

        if (!entityClass.isAnnotationPresent(DeepEntity.class)) {
            throw new AnnotationTypeMismatchException(null, entityClass.getCanonicalName());
        }

        super.validate();

        /* let's validate fieldNames in @DeepField annotations */
        Field[] deepFields = AnnotationUtils.filterDeepFields(entityClass);

        Map<String, Cell> colDefs = super.columnDefinitions();

        /* colDefs is null if table does not exist. I.E. this configuration will be used as an output configuration
         object, and the output table is dynamically created */
        if (colDefs == null) {
            return;
        }

        for (Field field : deepFields) {
            String annotationFieldName = AnnotationUtils.deepFieldName(field);

            if (!colDefs.containsKey(annotationFieldName)) {
                throw new DeepNoSuchFieldException("Unknown column name \'" + annotationFieldName + "\' specified for" +
                        " field " + entityClass.getCanonicalName() + "#" + field.getName() + ". Please, " +
                        "make sure the field name you specify in @DeepField annotation matches _exactly_ the column " +
                        "name " +
                        "in the database");
            }
        }
    }
1067731
@JsonIgnore
    public boolean isValid() {
        return StringUtils.isNotBlank(getMetadata())
            && StringUtils.isNotBlank(getSigningCertificate())
            && StringUtils.isNotBlank(getSigningKey())
            && StringUtils.isNotBlank(getEncryptionCertificate())
            && StringUtils.isNotBlank(getEncryptionKey());
    }
347476
def _validate_duplicates(self):
        
        # if connector is being created right now
        if not self.id:
            duplicates = []
            self.netengine_dict = self.netengine.to_dict()
            # loop over interfaces and check mac address
            for interface in self.netengine_dict['interfaces']:
                # avoid checking twice for the same interface (often ifconfig returns duplicates)
                if interface['mac_address'] in duplicates:
                    continue
                # check in DB
                if Interface.objects.filter(mac__iexact=interface['mac_address']).count() > 0:
                    duplicates.append(interface['mac_address'])

            # if we have duplicates raise validation error
            if len(duplicates) > 0:
                mac_address_string = ', '.join(duplicates)
                raise ValidationError(_('interfaces with the following mac addresses already exist: %s') % mac_address_string)
923281
public function validateMetadataEmbeds(EmbedInterface $metadata, MetadataFactory $mf)
    {
        foreach ($metadata->getEmbeds() as $key => $embeddedProp) {
            $this->validateMetadataAttributes($embeddedProp->embedMeta, $mf);
            if ($metadata !== $embeddedProp->embedMeta) {
                // Only re-validate if the embedded prop reference isn't the same as the parent.
                $this->validateMetadataEmbeds($embeddedProp->embedMeta, $mf);
            }
        }
        return true;
    }
1236259
@Override
	public void checkUniqueNames(Iterable<IEObjectDescription> descriptions, 
			CancelIndicator cancelIndicator, 
			ValidationMessageAcceptor acceptor) {
		Iterator<IEObjectDescription> iter = descriptions.iterator();
		if (!iter.hasNext())
			return;
		Map<EClass, Map<QualifiedName, IEObjectDescription>> clusterToNames = Maps.newHashMap();
		while(iter.hasNext()) {
			IEObjectDescription description = iter.next();
			checkDescriptionForDuplicatedName(description, clusterToNames, acceptor);
			operationCanceledManager.checkCanceled(cancelIndicator);
		}
	}
709600
def _validate_property_names(class_name, properties):
    """"""
    for property_name in properties:
        if not property_name or property_name.startswith(ILLEGAL_PROPERTY_NAME_PREFIXES):
            raise IllegalSchemaStateError(u'Class "{}" has a property with an illegal name: '
                                          u'{}'.format(class_name, property_name))
237058
private void validate() {
        if(driverClass == null) {
            throw new IllegalArgumentException("Driver class must be specified");
        }
        if(catalog == null || catalog.isEmpty()) {
            throw new IllegalArgumentException("Schema name must be specified");
        }
        if(table == null || table.isEmpty()) {
            throw new IllegalArgumentException("Table name must be specified");
        }
        if(connectionUrl == null || connectionUrl.isEmpty()) {
            if((host != null && !host.isEmpty()) && (port > 0)) {
                connectionUrl(getJdbcUrl());
            } else {
                throw new IllegalArgumentException("You must specify at least one of connectionUrl or host and port properties");
            }
        }
        if(partitionKey == null && numPartitions > 1) {
            throw new IllegalArgumentException("You must define a valid partition key for using more than one partition.");
        }
    }
1365297
function isValidProperty(name) {
    for (var keyName in EntryProperty) {
        if (EntryProperty.hasOwnProperty(keyName)) {
            if (EntryProperty[keyName] === name) {
                return true;
            }
        }
    }
    return false;
}