Creates a new property set containing the properties in this one,
            plus the ones of the property set passed as argument.
339700
def add (self, ps):
        
        assert isinstance(ps, PropertySet)
        if ps not in self.added_:
            self.added_[ps] = create(self.all_ + ps.all())
        return self.added_[ps]
1036450
@SuppressWarnings("unchecked")
    public A set(Iterable<Property> props) {
        if (Iterables.isEmpty(props)) {
            return (A) this;
        }
        return copy(delegate.put("data", Property.toArrayNode(props)));
    }
876194
public function generateGettersAndSettersFromProperties()
    {
        $propertyIterator = $this->getPropertyCollection()->getIterator();
        foreach ($propertyIterator as $property) {
            $this->getMethodCollection()->add(Method::createGetterFromProperty($property));
            $this->getMethodCollection()->add(Method::createSetterFromProperty($property));
        }
    }
794094
public static function create()
	{
		switch (func_num_args()) {
			case 0:
				return new ClassWithVarintProperty();
			case 1:
				return new ClassWithVarintProperty(func_get_arg(0));
			case 2:
				return new ClassWithVarintProperty(func_get_arg(0), func_get_arg(1));
			case 3:
				return new ClassWithVarintProperty(func_get_arg(0), func_get_arg(1), func_get_arg(2));
			case 4:
				return new ClassWithVarintProperty(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3));
			case 5:
				return new ClassWithVarintProperty(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4));
			case 6:
				return new ClassWithVarintProperty(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4), func_get_arg(5));
			case 7:
				return new ClassWithVarintProperty(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4), func_get_arg(5), func_get_arg(6));
			case 8:
				return new ClassWithVarintProperty(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4), func_get_arg(5), func_get_arg(6), func_get_arg(7));
			default:
				throw new \InvalidArgumentException('More than 8 arguments supplied, please be reasonable.');
		}
	}
316225
public GlobalJmxStatisticsConfigurationBuilder withProperties(Properties properties) {
      attributes.attribute(PROPERTIES).set(new TypedProperties(properties));
      return this;
   }
265422
public static <T> Set<T> createSet(T... args) {
        HashSet<T> newSet = new HashSet<T>();
        Collections.addAll(newSet, args);
        return newSet;
    }
1146768
private static void merge() {
        Set<String> keySet = props.keySet();
        for (Property property: props.values()){
            for (String key: keySet){
                if(!key.equals(property.getName())){
                    String val = property.getValue();
                    if(val.contains("${" + key + "}")){
                        property.setValue(val.replaceAll("\\$\\{" + key + "\\}", p(key)));
                    }
                }
            }
        }
    }
871945
private Properties createProperties(Properties propertyNames) {
        Properties props = new Properties();
        for (String key : propertiesArray) {
            if (sessionProperties.get(key) != null) {
                if (!key.equalsIgnoreCase(STOREPROTOCOLCLASSNAME) && !key.equalsIgnoreCase(TRANSPORTPROTOCOLCLASSNAME))
                {
                    props.put(key, sessionProperties.get(key));
                    if (propertyNames.getProperty(key) != null)
                        props.put(propertyNames.getProperty(key), sessionProperties.get(key));
                }
                else
                {
                    if (key.equalsIgnoreCase(STOREPROTOCOLCLASSNAME))
                        props.put("mail." + props.getProperty(STOREPROTOCOL) + ".class", sessionProperties.get(key));
                    else
                        props.put("mail." + props.getProperty(TRANSPORTPROTOCOL) + ".class", sessionProperties.get(key));
                }
            }
        }
        return props;
    }
346394
public Set<Object> keySet()
	{
		Map<Object,Object> properties = this.getProperties();
		if(properties == null)
			return null;
		
		return properties.keySet();
	}
1300833
public LocalProperties addUniqueFields(FieldSet uniqueFields) {
		LocalProperties copy = clone();
		
		if (copy.uniqueFields == null) {
			copy.uniqueFields = new HashSet<FieldSet>();
		}
		copy.uniqueFields.add(uniqueFields);
		return copy;
	}
1203444
@SuppressWarnings({ "rawtypes", "unchecked" })
	@Override
	public PrefixedPropertiesEnumeration<Object> elements() {
		lock.readLock().lock();
		try {
			final Collection values = values();
			final Iterator it = values.iterator();
			return new PrefixedPropertiesEnumerationImpl(it);
		} finally {
			lock.readLock().unlock();
		}
	}
197777
function set() {
    function Set() {}
    var ret = new Set();
    var arg, i, len;

    for(i = 0, len = arguments.length; i < len; i++) {
        arg = arguments[i];

        if(arg.constructor.name == 'Set') Object.keys(arg).filter(
            not(prop.bind(undefined, ret))
        ).forEach(addElem.bind(undefined, ret));
        else if(!(arg in ret)) addElem(ret, arg);
    }

    return Object.preventExtensions(ret);
}
336282
private ArrayList<AptPropertySet> initPropertySets()
    {
        ArrayList<AptPropertySet> propSets = new ArrayList<AptPropertySet>();

        if ( _intfDecl == null )
            return propSets;

        // TODO: enforce presence of prefixes when multiple property sets w/ the same
        // property name exist

        //
        // Add the intrinsic/base property set
        //

        TypeDeclaration basePropsDecl =
            _ap.getAnnotationProcessorEnvironment().getTypeDeclaration( "org.apache.beehive.controls.api.properties.BaseProperties" );
        if ( basePropsDecl != null )
        {
            propSets.add( new AptPropertySet( null, basePropsDecl, _ap ) );
        }

        //
        // Add external property sets
        //
        ExternalPropertySets extPropsAnnotation = _intfDecl.getAnnotation(ExternalPropertySets.class);
        if ( extPropsAnnotation != null )
        {
            if (isExtension())
            {
                _ap.printError( _intfDecl, "extpropertyset.illegal.usage" );
            }

            try
            {
                Class[] extProps = extPropsAnnotation.value();
            }
            catch ( MirroredTypesException mte )
            {
                Collection<String> extProps = mte.getQualifiedNames();
                for ( String extPropName : extProps )
                {
                    TypeDeclaration extPropDecl = _ap.getAnnotationProcessorEnvironment().getTypeDeclaration( extPropName );
                    if ( extPropDecl != null )
                    {
                        AptPropertySet extPropSet = new AptPropertySet( null, extPropDecl, _ap );
                        propSets.add( extPropSet );
                    }
                    else
                    {
                        _ap.printError( _intfDecl, "extpropertyset.type.not.found", extPropName );
                    }
                }
            }
        }

        //
        // Add nested property sets
        //

        if ( _intfDecl.getNestedTypes() == null )
            return propSets;

        for (TypeDeclaration innerDecl : _intfDecl.getNestedTypes())
        {
            boolean fError = false;
            if (innerDecl.getAnnotation(PropertySet.class) != null)
            {
                if (! (innerDecl instanceof AnnotationTypeDeclaration))
                {
                    _ap.printError( innerDecl, "propertyset.not.annotation.type" );
                    fError = true;
                }

                Retention ret = innerDecl.getAnnotation(Retention.class);
                if (ret == null || ret.value() != RetentionPolicy.RUNTIME)
                {
                    _ap.printError( innerDecl, "propertyset.missing.retention" );
                    fError = true;
                }

                if (isExtension())
                {
                    _ap.printError( innerDecl, "propertyset.illegal.usage.2" );
                    fError = true;
                }

                if ( !fError )
                    propSets.add(
                        new AptPropertySet(this, (AnnotationTypeDeclaration)innerDecl, _ap));
            }
        }

        //
        // Detect the presence of locally declared bound or constrained properties
        // Enforce property name (including prefix) uniqueness across all propertysets on this interface.
        //

        Set<String> propertyNames = new HashSet<String>();

        for (AptPropertySet propSet : propSets)
        {
            for (AptProperty prop : propSet.getProperties())
            {
                if (prop.isBound())
                    _hasBoundProperties = true;

                if (prop.isConstrained())
                    _hasConstrainedProperties = true;

                String propName = prop.getAccessorName();

                if ( propertyNames.contains( propName ) )
                {
                    _ap.printError( _intfDecl, "propertyset.duplicate.property.names", propName, propSet.getShortName() );
                }
                else
                {
                    propertyNames.add( propName );
                }
            }
        }

        return propSets;
    }
364477
private T copyProperties(T source) {
        T target = createEmpty(source.getClass());

        Map<String, PropertyDescriptor> mapTargetProps = MappingUtils.mapPropertyDescriptors(target.getClass());
        Map<String, PropertyDescriptor> mapSourceProps = MappingUtils.mapPropertyDescriptors(source.getClass());

        Object value = null;

        for (String propertyName : mapSourceProps.keySet()) {
            value = MappingUtils.callGetter(source, mapSourceProps.get(propertyName));

            MappingUtils.callSetter(target, mapTargetProps.get(propertyName), value);
        }

        return target;
    }
405242
public EntityBuilder addProperties(Map<String, Object> properties) {
    	if(MapUtils.isEmpty(properties)) {
    		throw new IllegalArgumentException("properties cannot be null or empty.");
    	}
        for (String key : properties.keySet()) {
            addProperty(key, properties.get(key));
        }
        return this;
    }
222282
private static Properties _newInitedProp(String templateDir, String charset) {
		final Properties properties = new Properties();

		properties.setProperty(Velocity.FILE_RESOURCE_LOADER_PATH, templateDir);
		properties.setProperty(Velocity.ENCODING_DEFAULT, charset);
		properties.setProperty(Velocity.INPUT_ENCODING, charset);
		// properties.setProperty(Velocity.OUTPUT_ENCODING, charset);

		return properties;
	}
132747
private Map<JSType, String> buildPropNames(Property prop) {
    UnionFind<JSType> pTypes = prop.getTypes();
    String pname = prop.name;
    Map<JSType, String> names = new HashMap<>();
    for (Set<JSType> set : pTypes.allEquivalenceClasses()) {
      checkState(!set.isEmpty());
      JSType representative = pTypes.find(set.iterator().next());
      String typeName = null;
      for (JSType type : set) {
        String typeString = type.toString();
        if (typeName == null || typeString.compareTo(typeName) < 0) {
          typeName = typeString;
        }
      }
      String newName;
      if ("{...}".equals(typeName)) {
        newName = pname;
      } else {
        newName = NONWORD_PATTERN.matcher(typeName).replaceAll("_") + '$' + pname;
      }
      names.put(representative, newName);
    }
    return names;
  }