/*
Set the value of the SubscriptionMessageType field in the message.

Javadoc description supplied by SubscriptionMessage interface.
552472
public final void setSubscriptionMessageType(SubscriptionMessageType value) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "setSubscriptionMessageType to " + value);
    /* Get the int value of the SubscriptionMessageType and set that into the subtype  */
    setSubtype(value.toInt());
  }
1026285
public Fortune setMessage(String value, SetMode mode) {
        putDirect(FIELD_Message, String.class, String.class, value, mode);
        return this;
    }
689862
public static void setGroovyObjectField(Object messageArgument, Class senderClass, GroovyObject receiver, String messageName) throws Throwable {
        try {
            receiver.getMetaClass().setAttribute(receiver, messageName, messageArgument);
        } catch (GroovyRuntimeException gre) {
            throw unwrap(gre);
        }
    }
589146
public void setSubscriptions(List<String> subscriptions) {
        this.subscriptions.clear();
        if(subscriptions == null) return;
        for(String currentSubscription: subscriptions) {
            if (this.getNotifierName().equals(AlertService.SupportedNotifier.GUS.getName())) {
                if (currentSubscription.isEmpty() || currentSubscription.length() < 10)
                    throw new IllegalArgumentException("GUS Subscription has to contain subjectId with more than 10 characters.");
            } else if (this.getNotifierName().equals(AlertService.SupportedNotifier.EMAIL.getName())) {

                if (currentSubscription.isEmpty() || !currentSubscription.contains("@")) {
                    String errorMessage = MessageFormat.format("Email Address {0} is not allowed as @ not present.",
                            currentSubscription);
                    throw new IllegalArgumentException(errorMessage);
                }
            } else if (this.getNotifierName().equals(AlertService.SupportedNotifier.CALLBACK.getName()) && currentSubscription.isEmpty()) {
                throw new IllegalArgumentException("Callback Notifier Subscription cannot be empty.");
            }
        }
        if (subscriptions != null && !subscriptions.isEmpty()) {
            this.subscriptions.addAll(subscriptions);
        }
    }
769755
public static void setFieldValeByType(Field field, Object obj, String value)
            throws Exception {

        Class<?> type = field.getType();

        String typeName = type.getName();

        if (typeName.equals("int")) {

            if (value.equals("")) {
                value = "0";
            }
            field.set(obj, Integer.valueOf(value));

        } else if (typeName.equals("long")) {

            if (value.equals("")) {
                value = "0";
            }
            field.set(obj, Long.valueOf(value));

        } else if (typeName.equals("boolean")) {

            if (value.equals("")) {
                value = "false";
            }
            field.set(obj, Boolean.valueOf(value));

        } else if (typeName.equals("double")) {

            if (value.equals("")) {
                value = "0.0";
            }
            field.set(obj, Double.valueOf(value));

        } else {

            field.set(obj, value);
        }
    }
98970
@JsonAnySetter
    public void setOthers(String name, Object value) {
        if(name.startsWith("_")) {
            // Just be defensive
            throw new RuntimeException("This is a reserved field, and should not be treated as document content.");
        }
        this.others.put(name, value);
    }
164465
public void setNotificationType(NotificationType notificationType) {
        addField(ConfigureNodeFields.notification_type, FormField.Type.list_single);
        setAnswer(ConfigureNodeFields.notification_type.getFieldName(), getListSingle(notificationType.toString()));
    }
216006
public final void setGuaranteedTargetMessagingEngineUUID(SIBUuid8 value) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setGuaranteedTargetMessagingEngineUUID", value);
        if (value != null)
            getHdr2().setField(JsHdr2Access.GUARANTEED_SET_TARGETMEUUID, value.toByteArray());
        else
            getHdr2().setField(JsHdr2Access.GUARANTEED_SET_TARGETMEUUID, null);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setGuaranteedTargetMessagingEngineUUID");
    }
993783
public static void setAdditionalFieldTypes(String spec, GelfMessageAssembler gelfMessageAssembler) {
        if (null != spec) {
            String[] properties = spec.split(MULTI_VALUE_DELIMITTER);

            for (String field : properties) {
                final int index = field.indexOf(EQ);
                if (-1 != index) {
                    gelfMessageAssembler.setAdditionalFieldType(field.substring(0, index), field.substring(index + 1));
                }
            }
        }
    }
310599
public void put(Field field, Class<?> arrayComponentType, Object value) {
    ArrayValueMap.ArrayValue arrayValue = fieldMap.get(field);
    if (arrayValue == null) {
      arrayValue = new ArrayValue(arrayComponentType);
      fieldMap.put(field, arrayValue);
    }
    arrayValue.addValue(arrayComponentType, value);
  }
1145991
public final void setGuaranteedProtocolType(ProtocolType value) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setGuaranteedProtocolType", value);
        getHdr2().setField(JsHdr2Access.GUARANTEED_SET_PROTOCOLTYPE, value.toByte());
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setGuaranteedProtocolType");
    }
981675
public Notification setFieldValue(String field, @Nullable String value) {
    fields.put(field, value);
    return this;
  }
992061
public void set(MessageMap value) {
    if (array != null)
      array[value.multiChoice.intValue()] = value;
    else
      hashtable.put(value.multiChoice, value);
  }
380514
@Override
	public void setSubject(String subject, java.util.Locale locale) {
		_commerceNotificationTemplate.setSubject(subject, locale);
	}
366042
public static void setFieldOnSuper(Object messageArgument, Class senderClass, Object receiver, String messageName) throws Throwable {
        try {
            if (receiver instanceof Class) {
                InvokerHelper.setAttribute(receiver, messageName, messageArgument);
            } else {
                MetaClass mc = ((GroovyObject) receiver).getMetaClass();
                mc.setAttribute(senderClass, receiver, messageName, messageArgument, true, true);
            }
        } catch (GroovyRuntimeException gre) {
            throw unwrap(gre);
        }
    }
236477
@Override
    public void setContentType(String value) {
        if (isCommitted()) {
            return;
        }
        if (null == value) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "setContentType: null, removing header");
            }
            this.response.removeHeader("Content-Type");
            return;
        }
        boolean addEncoding = false;
        String type = value;

        // see if the input value contains a charset
        int charsetIndex = value.indexOf("charset=");
        if (-1 != charsetIndex) {
            if (null == this.outWriter) {
                // can update both mime-set and charset
                addEncoding = true;
                this.encoding = connection.getEncodingUtils().stripQuotes(value.substring(charsetIndex + 8));
            } else {
                // can only update the mimeset so strip the charset off
                type = value.substring(0, charsetIndex).trim();
                charsetIndex = -1;
            }
        }
        if (null != this.outWriter) {
            // can still update the mime-type but not charset
            addEncoding = true;
        } else {
            // TODO don't quite follow why webcontainer checks for text*
            if (type.startsWith("text")) {
                addEncoding = true;
            }
        }
        if (addEncoding) {
            if (-1 != charsetIndex) {
                type = type.substring(0, charsetIndex - 1);
            }
            if (this.encoding != null) {
                type = type + ";charset=" + this.encoding;
            }
        }
        this.contentType = type;
        this.response.setHeader("Content-Type", type);
    }
517665
public void setValueFromObject(Object valueAsJava) {
 	if ((valueAsJava!=null) && (value==null)) {
 	    if (valueAsJava instanceof QualifiedName) { 
 		this.value=valueAsJava;
 	    } else if (valueAsJava instanceof LangString) { 
 		this.value=valueAsJava;
 	    } else if (valueAsJava instanceof byte[]) {
 		setValueAsJava((byte[]) valueAsJava);
 	    } else if (valueAsJava instanceof org.w3c.dom.Node) {
 		setValueAsJava((org.w3c.dom.Node)valueAsJava);
 	    } else {
 		this.value = valueAsJava.toString();
 	    }
 	}