Creates a configuration with the same content as this instance, but
with the specified identifier.
@param identifier the new identifier
@return a new configuration
348805
Configuration copyWithIdentifier(String identifier) {
		return new Configuration(details.builder().identifier(identifier).build(), new HashMap<>(config));
	}
453083
public static CConfiguration create() {
    // Create a new configuration instance, but do NOT initialize with
    // the Hadoop default properties.
    CConfiguration conf = new CConfiguration();
    conf.addResource("tigon-default.xml");
    conf.addResource("tigon-site.xml");
    return conf;
  }
108888
public Configuration createConfiguration() throws IOException, TemplateException {
        Configuration config = newConfiguration();
        Properties props = new Properties();

        // Merge local properties if specified.
        if (this.freemarkerSettings != null) {
            props.putAll(this.freemarkerSettings);
        }

        // FreeMarker will only accept known keys in its setSettings and
        // setAllSharedVariables methods.
        if (!props.isEmpty()) {
            config.setSettings(props);
        }

        if (this.freemarkerVariables != null && freemarkerVariables.size() > 0) {
            config.setAllSharedVariables(new SimpleHash(this.freemarkerVariables, config.getObjectWrapper()));
        }

        if (this.defaultEncoding != null) {
            config.setDefaultEncoding(this.defaultEncoding);
        }

        // determine FreeMarker TemplateLoader
        if (templateLoaders == null) {
            if (templateLoaderPaths != null && templateLoaderPaths.length > 0) {
                List<TemplateLoader> templateLoaderList = new ArrayList<>();
                for (String path : templateLoaderPaths) {
                    templateLoaderList.add(getTemplateLoaderForPath(path));
                }
                setTemplateLoader(templateLoaderList);
            }
        }

        TemplateLoader templateLoader = getAggregateTemplateLoader(templateLoaders);
        if (templateLoader != null) {
            config.setTemplateLoader(templateLoader);
        }

        // determine CustomTrimDirectives
        if (trimDirectives != null && trimDirectives.length > 0) {
            TrimDirectiveGroup group = new TrimDirectiveGroup(trimDirectives);
            for (Map.Entry<String, Map<String, TrimDirective>> directives : group.entrySet()) {
                config.setSharedVariable(directives.getKey(), directives.getValue());
            }
        }

        return config;
    }
394872
public function setIdentifier(Identifier $identifier)
    {
        if ($this->identifier !== null) {
            //TODO: throw exception
        }

        $this->identifier = $identifier;

        return $this;
    }
98499
public static Config newConfig(String confName) {
        Config c = new Config();
        c.parse(confName);
        return c;
    }
1138609
public synchronized void addSoftwareIdentifier(Identifier identifier) {
        //todo the following assertion should be removed after initial testing and implementation
        assert !(identifier instanceof CpeIdentifier) : "vulnerability identifier cannot be added to software identifiers";

        final Optional<Identifier> found = softwareIdentifiers.stream().filter(id
                -> id.getValue().equals(identifier.getValue())).findFirst();
        if (found.isPresent()) {
            //TODO - should we check for type of identifier?  I.e. could we see a Purl and GenericIdentifier with the same value
            final Identifier existing = found.get();
            if (existing.getConfidence().compareTo(identifier.getConfidence()) < 0) {
                existing.setConfidence(identifier.getConfidence());
            }
            if (existing.getNotes() != null && identifier.getNotes() != null) {
                existing.setNotes(existing.getNotes() + " " + identifier.getNotes());
            } else if (identifier.getNotes() != null) {
                existing.setNotes(identifier.getNotes());
            }
            if (existing.getUrl() == null && identifier.getUrl() != null) {
                existing.setUrl(identifier.getUrl());
            }
        } else {
            this.softwareIdentifiers.add(identifier);
        }
    }
997142
public function identifier($identifier = null)
    {
        if (null === $identifier) {
            return $this->identifier;
        }

        $this->identifier = $identifier;
        return $this;
    }
1193972
public static Matcher<ContextElement> identifier(final Matcher<Class<?>> matcher) {
    return new Matcher<ContextElement>() {

      @Override
      protected boolean matchesSafely(ContextElement t) {
        return matcher.matches(t.identifier());
      }

      @Override
      public String toString() {
        return "an identifier that is " + matcher;
      }
    };

  }
643374
public static Identity createExtendedIdentity(String extendedIdentifier,
			Charset c) throws MarshalException {
		return createExtendedIdentity(DomHelpers.toDocument(extendedIdentifier, c));
	}
279849
public String makeJavaIdentifier(String id)
    {
        String jid = makeJavaId(id);
        String old = map.put(jid, id);
        if (old != null && !old.equals(id))
        {
            throw new IllegalArgumentException("both "+id+" and "+old+" makes the same java id "+jid);
        }
        return jid;
    }
426249
protected Button newButton(final String id)
	{
		return new Button(id)
		{
			/** The serialVersionUID. */
			private static final long serialVersionUID = 1L;

			@Override
			public void onSubmit()
			{
				onSignup(ComponentFinder.findOrCreateNewAjaxRequestTarget(), getForm());
			}
		};
	}
689857
protected function createClient($identifier)
    {
        if (!class_exists($identifier)) {
            return $this->createBuiltinClient($identifier);
        }

        return $this->createCustomClient($identifier);
    }
449244
public OBinarySerializer<?> getObjectSerializer(final byte identifier) {
    OBinarySerializer<?> impl = serializerIdMap.get(identifier);
    if (impl == null) {
      final Class<? extends OBinarySerializer<?>> cls = serializerClassesIdMap.get(identifier);
      if (cls != null)
        try {
          impl = cls.newInstance();
        } catch (Exception e) {
          OLogManager.instance().error(this, "Cannot create an instance of class %s invoking the empty constructor", cls);
        }
    }
    return impl;
  }
599044
public static UniqueIds createUids(Configuration conf) {
        UniqueId usid = new UniqueId(SID_TABLE, SID_WIDTH, conf, true);
        UniqueId uiid = new UniqueId(IID_TABLE, IID_WIDTH, conf, true);
        UniqueId upid = new UniqueId(PID_TABLE, PID_WIDTH, conf, true);
        return new UniqueIds(uiid, usid, upid);
    }
907369
static InputSource createInputSource(Identifier id, Input input) {
    InputSource inputSource = createInputSource(input);
    if (id instanceof ExternalIdentifier)
      inputSource.setPublicId(((ExternalIdentifier)id).getPublicId());
    if (inputSource.getSystemId() == null)
      inputSource.setSystemId(getSystemId(id));
    return inputSource;
  }
310898
public function alias($identifier, $alias)
    {
        $alias      = trim((string) $alias);
        $identifier = (string) $identifier;

        //Don't register the alias if it's the same as the identifier
        if($alias != $identifier) {
            $this->_aliases[$alias] = (string) $identifier;
        }

        return $this;
    }
523325
@Override
	public CPSpecificationOption create(long CPSpecificationOptionId) {
		CPSpecificationOption cpSpecificationOption = new CPSpecificationOptionImpl();

		cpSpecificationOption.setNew(true);
		cpSpecificationOption.setPrimaryKey(CPSpecificationOptionId);

		String uuid = PortalUUIDUtil.generate();

		cpSpecificationOption.setUuid(uuid);

		cpSpecificationOption.setCompanyId(companyProvider.getCompanyId());

		return cpSpecificationOption;
	}