Checks if data set is mandatory but missing or non repeatable but having
multiple values in this IIM instance.

@param info
IIM data set to check
@return list of constraint violations, empty set if data set is valid
975833
public Set<ConstraintViolation> validate(DataSetInfo info) {
		Set<ConstraintViolation> errors = new LinkedHashSet<ConstraintViolation>();
		try {
			if (info.isMandatory() && get(info.getDataSetNumber()) == null) {
				errors.add(new ConstraintViolation(info, ConstraintViolation.MANDATORY_MISSING));
			}
			if (!info.isRepeatable() && getAll(info.getDataSetNumber()).size() > 1) {
				errors.add(new ConstraintViolation(info, ConstraintViolation.REPEATABLE_REPEATED));
			}
		} catch (SerializationException e) {
			errors.add(new ConstraintViolation(info, ConstraintViolation.INVALID_VALUE));
		}
		return errors;
	}
404471
public boolean validate(final List<Map<String, Object>> details) {
    if (this.getMetric() == null || this.getMetric().isEmpty()) {
      if (details != null) {
        details.add(getHttpDetails("Metric name was empty"));
      }
      LOG.warn("Metric name was empty: " + this);
      return false;
    }

    //TODO add blacklisted metric validatin here too
    
    if (this.getTimestamp() <= 0) {
      if (details != null) {
        details.add(getHttpDetails("Invalid timestamp"));
      }
      LOG.warn("Invalid timestamp: " + this);
      return false;
    }

    if (this.getValue() == null || this.getValue().isEmpty()) {
      if (details != null) {
        details.add(getHttpDetails("Empty value"));
      }
      LOG.warn("Empty value: " + this);
      return false;
    }

    if (this.getTags() == null || this.getTags().size() < 1) {
      if (details != null) {
        details.add(getHttpDetails("Missing tags"));
      }
      LOG.warn("Missing tags: " + this);
      return false;
    }
    return true;
  }
451931
@Override
    public List<String> getConstraintMapping() {
        List<String> result = new ArrayList<String>();

        for (String constraintMappingString : constraintMapping) {
            if (constraintMappingString != null) {
                constraintMappingString = constraintMappingString.trim();
            }
            result.add(constraintMappingString);
        }
        return result;
    }
216725
public void shouldBeEmpty(IDataSet dataSet, String tableName, AssertionErrorCollector errorCollector)
        throws DataSetException {
        final SortedTable tableState = new SortedTable(dataSet.getTable(tableName));
        int rowCount = tableState.getRowCount();
        if (rowCount != 0) {
            errorCollector.collect(new AssertionError(tableName + " expected to be empty, but was <" + rowCount + ">."));
        }
    }
1319851
public static <FACETEDTYPE extends Faceted<?>, FACETTYPE extends Facet<FACETEDTYPE>> boolean isConstraintSatisfied(
            Faceted<FACETTYPE> faceted, Set<Class<FACETTYPE>> requiredFacets)
   {
      boolean constraintsSatisfied = true;
      for (Class<FACETTYPE> type : requiredFacets)
      {
         if (!faceted.hasFacet(type))
         {
            constraintsSatisfied = false;
            break;
         }
      }
      return constraintsSatisfied;
   }
61466
Constraint getUniqueConstraintForColumns(int[] cols) {

        for (int i = 0, size = constraintList.length; i < size; i++) {
            Constraint c = constraintList[i];

            if (c.isUniqueWithColumns(cols)) {
                return c;
            }
        }

        return null;
    }
1342514
def validate(self):
        
        errors = []
        for param in self.required_params:
            if (not hasattr(self, param) or getattr(self, param) is None):
                errors.append("missing %s parameter" % (param))
        if (len(errors) > 0):
            raise IIIFInfoError("Bad data for info.json: " + ", ".join(errors))
        return True
1251845
public Set<ConstraintViolation> validate(int record) {
		Set<ConstraintViolation> errors = new LinkedHashSet<ConstraintViolation>();
		for (int ds = 0; ds < 250; ++ds) {
			try {
				DataSetInfo dataSetInfo = dsiFactory.create(IIM.DS(record, ds));
				errors.addAll(validate(dataSetInfo));
			} catch (InvalidDataSetException ignored) {
				// DataSetFactory doesn't know about this ds, so will skip it
			}
		}
		return errors;
	}
256955
public void setConstraintDetails(java.util.Collection<ConstraintDetail> constraintDetails) {
        if (constraintDetails == null) {
            this.constraintDetails = null;
            return;
        }

        this.constraintDetails = new java.util.ArrayList<ConstraintDetail>(constraintDetails);
    }
181255
@Override
    public Set<ManagedConnection> getInvalidConnections(@SuppressWarnings("rawtypes") Set connectionSet) throws ResourceException {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); 

        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(this, tc, "getInvalidConnections", connectionSet);

        Set<ManagedConnection> badSet = new HashSet<ManagedConnection>();
        WSRdbManagedConnectionImpl mc = null;

        // Loop through each ManagedConnection in the list, using each connection's
        // preTestSQLString to check validity. Different connections can
        // have different preTestSQLStrings if they were created by different
        // ManagedConnectionFactories.

        for (Iterator<?> it = connectionSet.iterator(); it.hasNext();) {
            mc = (WSRdbManagedConnectionImpl) it.next();
            if (!mc.validate())
                badSet.add(mc);
        }

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(this, tc, "getInvalidConnections", badSet); 
        return badSet;
    }
1242933
public List<HivePartitionDataset> findDatasets()
      throws IOException {
    Preconditions.checkArgument(this.state.contains(ComplianceConfigurationKeys.RESTORE_DATASET),
        "Missing required property " + ComplianceConfigurationKeys.RESTORE_DATASET);
    HivePartitionDataset hivePartitionDataset =
        HivePartitionFinder.findDataset(this.state.getProp(ComplianceConfigurationKeys.RESTORE_DATASET), this.state);

    Preconditions.checkNotNull(hivePartitionDataset, "No dataset to restore");
    return Collections.singletonList(hivePartitionDataset);
  }
245408
public boolean isDataValid() {
    boolean valid = false;
    for (Object value : values.values()) {
      if (value instanceof String) {
        String tt = (String) value;
        if (Strings.isNotBlank(tt)) {
          valid = true;
          break;
        }
      } else {
        if (null != value) {
          valid = true;
          break;
        }
      }
    }
    return valid;
  }
1259824
public List<DataColumnConstraints> queryByConstraintName(
			String constraintName) throws SQLException {
		return queryForEq(DataColumnConstraints.COLUMN_CONSTRAINT_NAME,
				constraintName);
	}
250933
public List<String> getRequiresFeature(ArtifactMetadata amd) {

        // Now check we have non-null input. I would like to check for valid
        // features
        // but as these may be user created I cannot find any way to do this so
        // it
        // is important there are no typos in the requires feature list TODO ?
        List<String> requiresFeature = new ArrayList<String>();
        String requiresFeatureProp = amd.getProperty(PROP_REQUIRE_FEATURE);
        if (requiresFeatureProp == null) {
            return null;
        }
        if (requiresFeatureProp.equals("")) {
            return requiresFeature;
        } else {
            String[] features = requiresFeatureProp.split("\\,");
            for (String feature : features) {
                requiresFeature.add(feature.trim());
            }
            return requiresFeature;
        }
    }
810622
OrderedHashSet getDependentConstraints(Constraint constraint) {

        OrderedHashSet set = new OrderedHashSet();

        for (int i = 0, size = constraintList.length; i < size; i++) {
            Constraint c = constraintList[i];

            if (c.getConstraintType() == Constraint.MAIN) {
                if (c.core.uniqueName == constraint.getName()) {
                    set.add(c);
                }
            }
        }

        return set;
    }
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
749764
OrderedHashSet getContainingConstraints(int colIndex) {

        OrderedHashSet set = new OrderedHashSet();

        for (int i = 0, size = constraintList.length; i < size; i++) {
            Constraint c = constraintList[i];

            if (c.hasColumnPlus(colIndex)) {
                set.add(c);
            }
        }

        return set;
    }