Replaces all properties with the same name as the supplied property
@param property property to replace with
@return a new copy of the template, or this if nothing was modified.
485768
@SuppressWarnings("unchecked")
    public A replace(Property property) {
        Data data = getData();
        Data replaced = data.replace(property);
        if (!replaced.isEmpty()) {
            return copy(delegate.put("data", Property.toArrayNode(replaced)));
        }
        return (A)this;
    }
859648
def rewrite_properties(self, properties):
        """"""
        with self.__properties_lock:
            self.__properties = properties
        self.__write_properties(None)
237030
public FulltextMatch addProperty(
                    final String property
                    )
    {
        if (property == null) {
            throw new IllegalArgumentException( "no property specified" );
        }

        _properties.add( property );

        return this;
    }
1327629
public static void setProperty2(Object newValue, Object object, String property) {
        setProperty(object, property, newValue);
    }
616811
void renameProperties() {
    int propsRenamed = 0;
    int propsSkipped = 0;
    int instancesRenamed = 0;
    int instancesSkipped = 0;
    int singleTypeProps = 0;

    Set<String> reported = new HashSet<>();
    for (Property prop : properties.values()) {
      if (prop.shouldRename()) {
        UnionFind<JSType> pTypes = prop.getTypes();
        Map<JSType, String> propNames = buildPropNames(prop);

        ++propsRenamed;
        prop.expandTypesToSkip();
        // This loop has poor locality, because instead of walking the AST,
        // we iterate over all accesses of a property, which can be in very
        // different places in the code.
        for (Map.Entry<Node, JSType> entry : prop.rootTypesByNode.entrySet()) {
          Node node = entry.getKey();
          JSType rootType = entry.getValue();
          if (prop.shouldRename(rootType)) {
            String newName = propNames.get(pTypes.find(rootType));
            node.setString(newName);
            compiler.reportChangeToEnclosingScope(node);
            ++instancesRenamed;
          } else {
            ++instancesSkipped;

            CheckLevel checkLevelForProp = propertiesToErrorFor.get(prop.name);
            if (checkLevelForProp != null
                && checkLevelForProp != CheckLevel.OFF
                && !reported.contains(prop.name)) {
              reported.add(prop.name);
              compiler.report(JSError.make(
                  node,
                  checkLevelForProp,
                  Warnings.INVALIDATION_ON_TYPE, prop.name,
                  rootType.toString(), ""));
            }
          }
        }
      } else {
        if (prop.skipRenaming) {
          ++propsSkipped;
        } else {
          ++singleTypeProps;
        }
      }
    }
    if (logger.isLoggable(Level.FINE)) {
      logger.fine("Renamed " + instancesRenamed + " instances of "
                  + propsRenamed + " properties.");
      logger.fine("Skipped renaming " + instancesSkipped + " invalidated "
                  + "properties, " + propsSkipped + " instances of properties "
                  + "that were skipped for specific types and " + singleTypeProps
                  + " properties that were referenced from only one type.");
    }
  }
208416
public PropertySet addAll( Collection<String> properties)
    {
    if( properties != null)
      {
      addAll( properties.iterator());
      }

    return this;
    }
246657
@NonNull
    public static ValueIndexItem property(@NonNull String property) {
        if (property == null) {
            throw new IllegalArgumentException("property cannot be null.");
        }
        return new ValueIndexItem(Expression.property(property));
    }
767276
protected void updatePropertiesInternal(Iterable<Property> properties, Iterable<PropertyRemoveMutation> propertyRemoves) {
        if (propertyRemoves != null) {
            this.propertyRemoveMutations = new ConcurrentSkipListSet<>();
            for (PropertyRemoveMutation propertyRemoveMutation : propertyRemoves) {
                removePropertyInternal(
                        propertyRemoveMutation.getKey(),
                        propertyRemoveMutation.getName(),
                        propertyRemoveMutation.getVisibility()
                );
                this.propertyRemoveMutations.add(propertyRemoveMutation);
            }
        }

        for (Property property : properties) {
            if (property.getKey() == null) {
                throw new IllegalArgumentException("key is required for property");
            }
            Object propertyValue = property.getValue();
            if (propertyValue instanceof PropertyValue && !((PropertyValue) propertyValue).isStore()) {
                continue;
            }
            Property existingProperty = getProperty(property.getKey(), property.getName(), property.getVisibility());
            if (existingProperty == null) {
                this.properties.add(property);
            } else {
                if (existingProperty instanceof MutableProperty) {
                    ((MutableProperty) existingProperty).update(property);
                } else {
                    throw new SecureGraphException("Could not update property of type: " + existingProperty.getClass().getName());
                }
            }
        }
    }
51823
public ModelBuilder properties(Map<String, ModelProperty> properties) {
    this.properties.putAll(nullToEmptyMap(properties));
    return this;
  }
295827
@NonNull
    public static SelectResult.As property(@NonNull String property) {
        if (property == null) {
            throw new IllegalArgumentException("property cannot be null.");
        }
        return new SelectResult.As(PropertyExpression.property(property));
    }
331365
public Set<String> getValues(String property) {
		Set<String> allValues = new HashSet<>();
		for (PropertiesCoreExtension<T, ?, ?, ?> properties : propertiesMap
				.values()) {
			allValues.addAll(properties.getValues(property));
		}
		return allValues;
	}
880107
public PropertyRequest addProperty(ElementDescriptor<?> property)
	{
		if (mProp == null)
		{
			mProp = new HashMap<ElementDescriptor<?>, Object>(16);
		}
		mProp.put(property, null);
		return this;
	}
760574
static public InputStream replaceProperties(File file, Properties props) throws IOException, SubstitutionException {
	return replaceProperties(new FileInputStream(file), props);
    }
1071802
public Configuration withProperties(java.util.Map<String, String> properties) {
        setProperties(properties);
        return this;
    }
985915
protected void copyProperties(Object dest, Object source) {
        try {
            BeanUtils.copyProperties(dest, source);
        } catch (Exception e) {
            String errorMessage = MessageFormat.format("M:{0};;E:{1}",
                    e.getCause().getMessage(), e.toString());
            throw new WebApplicationException(errorMessage, Status.BAD_REQUEST);
        }
    }
710237
private String replaceProperties(String message, Map<String, String> map) {
        if (map != null) {
            for (Entry<String, String> entr : map.entrySet()) {
                message = StringUtils.replace(message, "@{" + entr.getKey() + "}", entr.getValue());
            }
        }
        return message;
    }
931004
protected String replaceAllProperties(String str,
			final Properties submittedProps, final Properties xmlProperties) {

		int startIndex = 0;
		NextProperty nextProp = this.findNextProperty(str, startIndex);
		
		
		while (nextProp != null) {

			// get the start index past this property for the next property in
			// the string
			//startIndex = this.getEndIndexOfNextProperty(str, startIndex);
			startIndex = nextProp.endIndex;

			// resolve the property
			String nextPropValue = this.resolvePropertyValue(nextProp.propName, nextProp.propType, submittedProps, xmlProperties);
			
			//if the property didn't resolve use the default value if it exists
			if (nextPropValue.equals(UNRESOLVED_PROP_VALUE)){
			    if (nextProp.defaultValueExpression != null) { 
			        nextPropValue = this.replaceAllProperties(nextProp.defaultValueExpression, submittedProps, xmlProperties);
			    }
			}
			

			// After we get this value the lenght of the string might change so
			// we need to reset the start index
			int lengthDifference = 0;
			switch(nextProp.propType) {
			
				case JOB_PARAMETERS:
					lengthDifference = nextPropValue.length() - (nextProp.propName.length() + "#{jobParameters['']}".length()); // this can be a negative value
					startIndex = startIndex + lengthDifference; // move start index for next property
					str = str.replace("#{jobParameters['" + nextProp.propName + "']}" + nextProp.getDefaultValExprWithDelimitersIfExists(), nextPropValue);
					break;
				case JOB_PROPERTIES:
					lengthDifference = nextPropValue.length() - (nextProp.propName.length() + "#{jobProperties['']}".length()); // this can be a negative value
					startIndex = startIndex + lengthDifference; // move start index for next property
					str = str.replace("#{jobProperties['" + nextProp.propName + "']}" + nextProp.getDefaultValExprWithDelimitersIfExists(), nextPropValue);
					break;
				case SYSTEM_PROPERTIES:
					lengthDifference = nextPropValue.length() - (nextProp.propName.length() + "#{systemProperties['']}".length()); // this can be a negative value
					startIndex = startIndex + lengthDifference; // move start index for next property
					str = str.replace("#{systemProperties['" + nextProp.propName + "']}" + nextProp.getDefaultValExprWithDelimitersIfExists(), nextPropValue);
					break;
				case PARTITION_PROPERTIES:
					lengthDifference = nextPropValue.length() - (nextProp.propName.length() + "#{partitionPlan['']}".length()); // this can be a negative value
					startIndex = startIndex + lengthDifference; // move start index for next property
					str = str.replace("#{partitionPlan['" + nextProp.propName + "']}" + nextProp.getDefaultValExprWithDelimitersIfExists(), nextPropValue);
					break;					

			}

			// find the next property
			nextProp = this.findNextProperty(str, startIndex);
		}

		return str;
	}