Adds an import princial translation to the configuration.<p>

@param type the princial type ("USER" or "GROUP")
@param from the "from" translation source
@param to the "to" translation target
330024
public void addImportPrincipalTranslation(String type, String from, String to) {

        if (LOG.isDebugEnabled()) {
            LOG.debug(
                Messages.get().getBundle().key(
                    Messages.LOG_IMPORTEXPORT_ADDED_PRINCIPAL_TRANSLATION_3,
                    type,
                    from,
                    to));
        }
        if (I_CmsPrincipal.PRINCIPAL_GROUP.equalsIgnoreCase(type)) {
            m_importGroupTranslations.put(from, to);
            if (LOG.isInfoEnabled()) {
                LOG.info(
                    Messages.get().getBundle().key(Messages.INIT_IMPORTEXPORT_ADDED_GROUP_TRANSLATION_2, from, to));
            }
        } else if (I_CmsPrincipal.PRINCIPAL_USER.equalsIgnoreCase(type)) {
            m_importUserTranslations.put(from, to);
            if (LOG.isInfoEnabled()) {
                LOG.info(Messages.get().getBundle().key(Messages.INIT_IMPORTEXPORT_ADDED_USER_TRANSLATION_2, from, to));
            }
        }
    }
1177456
@SuppressWarnings("WeakerAccess")
  public CreateInstanceRequest setType(@Nonnull Instance.Type type) {
    Preconditions.checkNotNull(type);
    Preconditions.checkArgument(type != Instance.Type.UNRECOGNIZED, "Type is unrecognized");
    builder.getInstanceBuilder().setType(type.toProto());
    return this;
  }
1008432
protected function insertRelationData($from, $to, $type, array $keys)
    {
        $config                    = Config::table($from);
        $content                   = $config->get();
        $content->relations->{$to} = [
            'type' => $type,
            'keys' => $keys,
        ];
        $config->put($content);
    }
1110024
public static ExportType addExportConfigToDRConflictsTable(ExportType export) {
        if (export == null) {
            export = new ExportType();
        }
        boolean userDefineStream = false;
        for (ExportConfigurationType exportConfiguration : export.getConfiguration()) {
            if (exportConfiguration.getTarget().equals(DR_CONFLICTS_TABLE_EXPORT_GROUP)) {
                userDefineStream = true;
            }
        }

        if (!userDefineStream) {
            ExportConfigurationType defaultConfiguration = new ExportConfigurationType();
            defaultConfiguration.setEnabled(true);
            defaultConfiguration.setTarget(DR_CONFLICTS_TABLE_EXPORT_GROUP);
            defaultConfiguration.setType(ServerExportEnum.FILE);

            // type
            PropertyType type = new PropertyType();
            type.setName("type");
            type.setValue(DEFAULT_DR_CONFLICTS_EXPORT_TYPE);
            defaultConfiguration.getProperty().add(type);

            // nonce
            PropertyType nonce = new PropertyType();
            nonce.setName("nonce");
            nonce.setValue(DEFAULT_DR_CONFLICTS_NONCE);
            defaultConfiguration.getProperty().add(nonce);

            // outdir
            PropertyType outdir = new PropertyType();
            outdir.setName("outdir");
            outdir.setValue(DEFAULT_DR_CONFLICTS_DIR);
            defaultConfiguration.getProperty().add(outdir);

            // k-safe file export
            PropertyType ksafe = new PropertyType();
            ksafe.setName("replicated");
            ksafe.setValue("true");
            defaultConfiguration.getProperty().add(ksafe);

            // skip internal export columns
            PropertyType skipinternal = new PropertyType();
            skipinternal.setName("skipinternals");
            skipinternal.setValue("true");
            defaultConfiguration.getProperty().add(skipinternal);

            export.getConfiguration().add(defaultConfiguration);
        }
        return export;
    }
790061
public Object convert(Class<?> type, String origin) throws ConversionException {
        if (origin == null) {
            return convertNullValue(type);
        }

        Converter converter = find(type);
        try {
            return converter.convert(origin);
        } catch (Exception e) {
            throw new ConversionException(String.format("Could not convert string <%s> to type <%s>", origin, type), e);
        }
    }
521651
@Deprecated
    @JsonProperty("from")
    public void setFrom(String from) throws IllegalArgumentException {
        if (messagingServiceSID != null) {
            throw new IllegalArgumentException("You must specify either `from` or `messagingServiceSID`, but not both");
        }
        this.from = from;
    }
437768
private void init(Class<?> type) {

    ParameterizedType parameterizedType =
      stream(nullSafeArray(type.getGenericInterfaces(), Type.class))
        .filter(this::isParameterizedFunctionType)
        .findFirst()
        .map(it -> (ParameterizedType) it)
        .orElseGet(() -> {

          Type genericSuperclass = type.getGenericSuperclass();

          return isParameterizedFunctionType(genericSuperclass) ? (ParameterizedType) genericSuperclass : null;

        });

    this.sourceType = parameterizedType != null
      ? ClassUtils.toRawType(parameterizedType.getActualTypeArguments()[0])
      : Object.class;

    this.targetType = parameterizedType != null
      ? ClassUtils.toRawType(parameterizedType.getActualTypeArguments()[1])
      : Object.class;
  }
506627
public boolean hasConversion(String type) {
		if ((isImplicitSarlTypes() && type.startsWith(IMPLICIT_PACKAGE))
			|| isImplicitJvmTypes()) {
			return true;
		}
		if (this.mapping == null) {
			this.mapping = initMapping();
		}
		return this.mapping.containsKey(type);
	}
175019
protected void addIssue(final JvmDeclaredType type, final String fileName) {
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("The type ");
    String _simpleName = type.getSimpleName();
    _builder.append(_simpleName);
    _builder.append(" is already defined");
    {
      if ((fileName != null)) {
        _builder.append(" in ");
        _builder.append(fileName);
      }
    }
    _builder.append(".");
    final String message = _builder.toString();
    final EObject sourceElement = this.associations.getPrimarySourceElement(type);
    if ((sourceElement == null)) {
      this.addIssue(message, type, IssueCodes.DUPLICATE_TYPE);
    } else {
      final EStructuralFeature feature = sourceElement.eClass().getEStructuralFeature("name");
      this.addIssue(message, sourceElement, feature, IssueCodes.DUPLICATE_TYPE);
    }
  }
281146
private boolean addType(TypeDefinition type) {

        if (type == null) {
            return false;
        }

        if (type.getBaseTypeId() == null) {
            return false;
        }

        // find base type
        TypeDefinition baseType = null;
        if (type.getBaseTypeId() == BaseTypeId.CMIS_DOCUMENT) {
            baseType = copyTypeDefintion(m_types.get(DOCUMENT_TYPE_ID).getTypeDefinition());
        } else if (type.getBaseTypeId() == BaseTypeId.CMIS_FOLDER) {
            baseType = copyTypeDefintion(m_types.get(FOLDER_TYPE_ID).getTypeDefinition());
        } else if (type.getBaseTypeId() == BaseTypeId.CMIS_RELATIONSHIP) {
            baseType = copyTypeDefintion(m_types.get(RELATIONSHIP_TYPE_ID).getTypeDefinition());
        } else if (type.getBaseTypeId() == BaseTypeId.CMIS_POLICY) {
            baseType = copyTypeDefintion(m_types.get(POLICY_TYPE_ID).getTypeDefinition());
        } else {
            return false;
        }

        AbstractTypeDefinition newType = (AbstractTypeDefinition)copyTypeDefintion(type);

        // copy property definition
        for (PropertyDefinition<?> propDef : baseType.getPropertyDefinitions().values()) {
            ((AbstractPropertyDefinition<?>)propDef).setIsInherited(Boolean.TRUE);
            newType.addPropertyDefinition(propDef);
        }

        // add it
        addTypeInternal(newType);
        return true;
    }
364712
@Deprecated
	public void setType(final DropdownType type) {
		super.setEditable(DropdownType.COMBO.equals(type));
		getOrCreateComponentModel().type = type;
	}
1331506
public static void addTypeDeclaration(CompilationUnit cu, TypeDeclaration type) {
        List<TypeDeclaration> types = cu.getTypes();
        if (types == null) {
            types = new ArrayList<TypeDeclaration>();
            cu.setTypes(types);
        }
        types.add(type);

    }
941647
@SuppressWarnings("unchecked")
    public <T extends WebLocatorAbstractBuilder> T setType(final String type) {
        pathBuilder.setType(type);
        return (T) this;
    }
108852
public void setDefaultAutoGeneratedContent(String type) {
		getXBlockExpression().getExpressions().clear();
		if (Strings.isEmpty(type)) {
			setInnerDocumentation(getAutoGeneratedActionString());
		} else {
			IExpressionBuilder expr = addExpression();
			String defaultValue = expr.getDefaultValueForType(type);
			if (Strings.isEmpty(defaultValue)) {
				setInnerDocumentation(getAutoGeneratedActionString());
			} else {
				expr.setExpression(defaultValue);
				expr.setDocumentation(getAutoGeneratedActionString());
			}
		}
	}
305649
public static void addImport( Instance instance, String componentOrFacetName, Import imp ) {

		Collection<Import> imports = instance.getImports().get( componentOrFacetName );
		if(imports == null) {
			imports = new LinkedHashSet<Import> ();
			instance.getImports().put( componentOrFacetName, imports );
		}

		if( ! imports.contains( imp ))
			imports.add( imp );
	}
33541
private void setTypeRequested(ResourceType type) {
    synchronized (typeToFirstWait) {
      if (!typeToFirstWait.containsKey(type)) {
        typeToFirstWait.put(type, null);
      }
    }
  }
1065440
public void addUpperConstraint(String type) {
		final JvmUpperBound constraint = this.jvmTypesFactory.createJvmUpperBound();
		constraint.setTypeReference(newTypeRef(this.context, type));
		getJvmTypeParameter().getConstraints().add(constraint);
	}