Ensure a property occurs once.

@param propertyName
the property name
@param properties
a list of properties to query
@throws ValidationException
when the specified property does not occur once
425323
public void assertOne(final String propertyName,
            final PropertyList properties) throws ValidationException {

        if (properties.getProperties(propertyName).size() != 1) {
            throw new ValidationException(ASSERT_ONE_MESSAGE, new Object[] {propertyName});
        }
    }
52264
public void assertNotEmpty(Collection<?> collection, String propertyName) {
        if (CollectionUtils.isNullOrEmpty(collection)) {
            problemReporter.report(new Problem(this, String.format("%s requires one or more items", propertyName)));
        }
    }
216144
public void validate(Object o)
    {
        Matcher m = m_pattern.matcher(String.valueOf(o));
        if (!m.matches())
        {
            String message = m_propertyMetadata.getMessageSourceAccessor().getMessage(m_message, new Object[]{ m_propertyMetadata.getLabelName(), String.valueOf(o) });
            throw new ValidationException(message);
        }
    }
504894
@Override
  public void setSystemProperty(String propertyName, String value) {
    if (Strings.isNullOrEmpty(propertyName)) {
      throw new IllegalArgumentException("Property name can't be empty.");
    }

    execute(
        "-selendroid-setAndroidOsSystemProperty",
        ImmutableMap.of(
            "propertyName", propertyName,
            "value", value));
  }
1247687
@com.fasterxml.jackson.annotation.JsonProperty("validationErrors")
    public void setValidationErrors(java.util.Collection<ValidationError> validationErrors) {
        if (validationErrors == null) {
            this.validationErrors = null;
            return;
        }

        this.validationErrors = new java.util.ArrayList<ValidationError>(validationErrors);
    }
1335423
public void validateFname(final String fname) {
        Validate.validState(
                TENANT_FNAME_VALIDATOR_PATTERN.matcher(fname).matches(),
                "Invalid tenant fname '%s'  -- fnames must match %s .",
                fname,
                TENANT_FNAME_VALIDATOR_REGEX);
    }
16992
public void assertOne(final String paramName,
            final ParameterList parameters) throws ValidationException {

        if (parameters.getParameters(paramName).size() != 1) {
            throw new ValidationException(ASSERT_ONE_MESSAGE, new Object[] {paramName});
        }
    }
308889
public static OpsGenieClientValidationException missingMultipleMandatoryProperty(String... propertyNames) {
        if (propertyNames != null && propertyNames.length > 0) {
            String missingProperties = "[" + propertyNames[0];
            for (int i = 1; i < propertyNames.length; i++)
                missingProperties += " or " + propertyNames[i];
            missingProperties += "]";
            return new OpsGenieClientValidationException("Missing mandatory property " + missingProperties, MISSING_MANDATORY_PROPERTY);
        }
        return null;
    }
}
537195
private static void checkProperties(ConverterProperties properties) {
        boolean isIllegal = properties.isOnlyScanNonStaticMethod() && properties.isOnlyScanStaticMethod();
        if (isIllegal) {
            throw InvalidConfigurationException
                    .of("Only scanning static methods or scanning only non static methods can only select one");
        }
    }
897084
static void validateValueUniquenessInScope(String qualifiedName,
      List<TypeElement> nestedElements) {
    Set<String> names = new LinkedHashSet<>();
    for (TypeElement nestedElement : nestedElements) {
      if (nestedElement instanceof EnumElement) {
        EnumElement enumElement = (EnumElement) nestedElement;
        for (EnumConstantElement constant : enumElement.constants()) {
          String name = constant.name();
          if (!names.add(name)) {
            throw new IllegalStateException(
                "Duplicate enum constant " + name + " in scope " + qualifiedName);
          }
        }
      }
    }
  }
1307208
public void setProperty(final String propertyName, final List<String> values) {
        Preconditions.checkNotNull(propertyName);
        if (values == null) {
            properties.put(propertyName, null);
            return;
        }
        properties.put(propertyName, values);
    }
1132541
public void setReference(final String propertyName, final BeanId value) {
        Preconditions.checkNotNull(propertyName);
        if (value == null) {
            references.put(propertyName, null);
            return;
        }
        checkCircularReference(value);
        List<BeanId> values = new ArrayList<>();
        values.add(value);
        references.put(propertyName, values);
    }
110114
public static void assertTrueOrInvalidPropertyName(boolean expression, SQLProperty item1, SQLProperty item2) {
		if (!expression) {
			String msg = String.format("Properties '%s#%s' and '%s#%s' must have same column name",
					item1.getParent().name, item1.name, item2.getParent().name, item2.name);
			throw (new InvalidPropertyToColumnConversion(msg));
		}

	}
1223050
static void validate( Map<String,String> targetProperties ) throws TargetException {

		checkProperty( PROVIDER_ID, targetProperties );
		checkProperty( ENDPOINT, targetProperties );
		checkProperty( IMAGE_NAME, targetProperties );
		checkProperty( SECURITY_GROUP, targetProperties );
		checkProperty( IDENTITY, targetProperties );
		checkProperty( CREDENTIAL, targetProperties );
		checkProperty( HARDWARE_NAME, targetProperties );
	}
416770
public void registerPropertyExclusions( Class target, String[] properties ) {
      if( target != null && properties != null && properties.length > 0 ) {
         Set set = (Set) exclusionMap.get( target );
         if( set == null ) {
            set = new HashSet();
            exclusionMap.put( target, set );
         }
         for( int i = 0; i < properties.length; i++ ) {
            if( !set.contains( properties[i] ) ) {
               set.add( properties[i] );
            }
         }
      }
   }
234259
public void afterPropertiesSet() throws Exception {
        // try to find xml message validator in registry
        for (MessageValidator<? extends ValidationContext> messageValidator : messageValidatorRegistry.getMessageValidators()) {
            if (messageValidator instanceof DomXmlMessageValidator &&
                    messageValidator.supportsMessageType(MessageType.XML.name(), new DefaultMessage(""))) {
                xmlMessageValidator = (DomXmlMessageValidator) messageValidator;
            }
        }

        if (xmlMessageValidator == null) {
            LOG.warn("No XML message validator found in Spring bean context - setting default validator");
            xmlMessageValidator = new DomXmlMessageValidator();
            xmlMessageValidator.setApplicationContext(applicationContext);
        }
    }
214689
public boolean repeat(Map<String, CSSProperty> properties,
			Map<String, Term<?>> values) {
		for (int i = 0; i < times; i++) {
			if (!operation(i, properties, values))
				return false;
		}
		return true;
	}