/** * Public only for serialization; please use {@link ScriptContextBuilder}. * @param scriptLanguage The script language. Must not be null. * @param scriptText The script text. Must not be null. * @param scriptArguments The script arguments. May be null. */ public ScriptContext(String scriptLanguage, String scriptText, Map<String,Object> scriptArguments) { if (scriptLanguage == null) { throw new IllegalArgumentException("Argument 'scriptLanguage' must be specified"); } if (scriptText == null) { throw new IllegalArgumentException("Argument 'scriptText' must be specified"); } //clone script arguments and options - this serves two purposes //1)makes sure everthing is serializable //2)does a deep copy @SuppressWarnings("unchecked") Map<String,Object> scriptArgumentsClone = (Map<String,Object>)SerializerUtil.cloneObject(scriptArguments); _scriptLanguage = scriptLanguage; _scriptText = scriptText; _scriptArguments = CollectionUtil.asReadOnlyMap(scriptArgumentsClone); }
/** * Public only for serialization; please use {@link OperationOptionsBuilder}. * * @param operationOptions The options. */ public OperationOptions(Map<String, Object> operationOptions) { for (Object value : operationOptions.values()) { FrameworkUtil.checkOperationOptionValue(value); } // clone options to do a deep copy in case anything // is an array @SuppressWarnings("unchecked") Map<String, Object> operationOptionsClone = (Map<String, Object>) SerializerUtil.cloneObject(operationOptions); this.operationOptions = CollectionUtil.asReadOnlyMap(operationOptionsClone); }
public HelloResponse(Throwable exception, Map<String, Object> serverInfo, List<ConnectorKey> connectorKeys, List<RemoteConnectorInfoImpl> connectorInfos) { this.exception = exception; this.serverInfo = CollectionUtil.asReadOnlyMap(serverInfo); this.connectorKeys = CollectionUtil.newReadOnlyList(connectorKeys); this.connectorInfos = CollectionUtil.newReadOnlyList(connectorInfos); }
public HelloResponse(Throwable exception, Map<String, Object> serverInfo, List<ConnectorKey> connectorKeys, List<RemoteConnectorInfoImpl> connectorInfos) { this.exception = exception; this.serverInfo = CollectionUtil.asReadOnlyMap(serverInfo); this.connectorKeys = CollectionUtil.newReadOnlyList(connectorKeys); this.connectorInfos = CollectionUtil.newReadOnlyList(connectorInfos); }
/** * Public only for serialization; please use {@link OperationOptionsBuilder}. * * @param operationOptions The options. */ public OperationOptions(Map<String, Object> operationOptions) { for (Object value : operationOptions.values()) { FrameworkUtil.checkOperationOptionValue(value); } // clone options to do a deep copy in case anything // is an array @SuppressWarnings("unchecked") Map<String, Object> operationOptionsClone = (Map<String, Object>) SerializerUtil .cloneObject(operationOptions); _operationOptions = CollectionUtil.asReadOnlyMap(operationOptionsClone); }
/** * Public only for serialization; please use {@link OperationOptionsBuilder}. * * @param operationOptions The options. */ public OperationOptions(Map<String, Object> operationOptions) { for (Object value : operationOptions.values()) { FrameworkUtil.checkOperationOptionValue(value); } // clone options to do a deep copy in case anything // is an array @SuppressWarnings("unchecked") Map<String, Object> operationOptionsClone = (Map<String, Object>) SerializerUtil.cloneObject(operationOptions); this.operationOptions = CollectionUtil.asReadOnlyMap(operationOptionsClone); }
temp.put(op, resolvedClasses); }); this.supportedObjectClassesByOperation = CollectionUtil.asReadOnlyMap(temp); temp.put(op, resolvedClasses); }); this.supportedOptionsByOperation = CollectionUtil.asReadOnlyMap(temp);
/** * Transform a <code>Collection</code> of {@link Attribute} instances into a * {@link Map}. * * The key to each element in the map is the <i>name</i> of an * <code>Attribute</code>. The value of each element in the map is the * <code>Attribute</code> instance with that name. * * @param attributes * set of attribute to transform to a map. * @return a map of string and attribute. * @throws NullPointerException * if the parameter <strong>attributes</strong> is * <strong>null</strong>. */ public static Map<String, Attribute> toMap(final Collection<? extends Attribute> attributes) { final Map<String, Attribute> ret = CollectionUtil.<Attribute> newCaseInsensitiveMap(); for (Attribute attr : attributes) { ret.put(attr.getName(), attr); } return CollectionUtil.asReadOnlyMap(ret); }
/** * Transform a <code>Collection</code> of {@link AttributeDelta} instances * into a {@link Map}. * * The key to each element in the map is the <i>name</i> of an * <code>AttributeDelta</code>. The value of each element in the map is the * <code>AttributeDelta</code> instance with that name. * * @param attributesDelta * set of attributesDelta to transform to a map. * @return a map of string and attributesDelta. * @throws NullPointerException * if the parameter <strong>attributesDelta</strong> is * <strong>null</strong>. */ public static Map<String, AttributeDelta> toMap(final Collection<? extends AttributeDelta> attributesDelta) { final Map<String, AttributeDelta> ret = CollectionUtil.<AttributeDelta>newCaseInsensitiveMap(); for (AttributeDelta attr : attributesDelta) { ret.put(attr.getName(), attr); } return CollectionUtil.asReadOnlyMap(ret); }
/** * Transform a <code>Collection</code> of {@link Attribute} instances into a * {@link Map}. * * The key to each element in the map is the <i>name</i> of an * <code>Attribute</code>. The value of each element in the map is the * <code>Attribute</code> instance with that name. * * @param attributes * set of attribute to transform to a map. * @return a map of string and attribute. * @throws NullPointerException * if the parameter <strong>attributes</strong> is * <strong>null</strong>. */ public static Map<String, Attribute> toMap(final Collection<? extends Attribute> attributes) { final Map<String, Attribute> ret = CollectionUtil.<Attribute> newCaseInsensitiveMap(); for (Attribute attr : attributes) { ret.put(attr.getName(), attr); } return CollectionUtil.asReadOnlyMap(ret); }
temp.put(op, resolvedClasses); }); this.supportedObjectClassesByOperation = CollectionUtil.asReadOnlyMap(temp); temp.put(op, resolvedClasses); }); this.supportedOptionsByOperation = CollectionUtil.asReadOnlyMap(temp);
/** * Transform a <code>Collection</code> of {@link Attribute} instances into * a {@link Map}. The key to each element in the map is the <i>name</i> of * an <code>Attribute</code>. The value of each element in the map is the * <code>Attribute</code> instance with that name. * * @param attributes * set of attribute to transform to a map. * @return a map of string and attribute. * @throws NullPointerException * iff the parameter <strong>attributes</strong> is * <strong>null</strong>. */ public static Map<String, Attribute> toMap( Collection<? extends Attribute> attributes) { Map<String, Attribute> ret = CollectionUtil.<Attribute>newCaseInsensitiveMap(); for (Attribute attr : attributes) { ret.put(attr.getName(), attr); } return CollectionUtil.asReadOnlyMap(ret); }
/** * Transform a <code>Collection</code> of {@link AttributeDelta} instances * into a {@link Map}. * * The key to each element in the map is the <i>name</i> of an * <code>AttributeDelta</code>. The value of each element in the map is the * <code>AttributeDelta</code> instance with that name. * * @param attributesDelta * set of attributesDelta to transform to a map. * @return a map of string and attributesDelta. * @throws NullPointerException * if the parameter <strong>attributesDelta</strong> is * <strong>null</strong>. */ public static Map<String, AttributeDelta> toMap(final Collection<? extends AttributeDelta> attributesDelta) { final Map<String, AttributeDelta> ret = CollectionUtil.<AttributeDelta>newCaseInsensitiveMap(); for (AttributeDelta attr : attributesDelta) { ret.put(attr.getName(), attr); } return CollectionUtil.asReadOnlyMap(ret); }
temp.put(op, resolvedClasses); _supportedObjectClassesByOperation = CollectionUtil.asReadOnlyMap(temp); temp.put(op, resolvedClasses); _supportedOptionsByOperation = CollectionUtil.asReadOnlyMap(temp);
/** * Copy Constructor. * * @param source */ public ConnectorEvent(ConnectorEvent source) { super(source.getSource()); this.topic = source.getTopic(); properties = CollectionUtil.asReadOnlyMap(source.getProperties()); }
/** * Copy Constructor. * * @param source */ public ConnectorEvent(ConnectorEvent source) { super(source.getSource()); this.topic = source.getTopic(); properties = CollectionUtil.asReadOnlyMap(source.getProperties()); }
/** * Public only for serialization; please use {@link ScriptContextBuilder}. * * @param scriptLanguage * The script language. Must not be null. * @param scriptText * The script text. Must not be null. * @param scriptArguments * The script arguments. May be null. */ public ScriptContext(String scriptLanguage, String scriptText, Map<String, Object> scriptArguments) { if (StringUtil.isBlank(scriptLanguage)) { throw new IllegalArgumentException("Argument 'scriptLanguage' must be specified"); } if (StringUtil.isBlank(scriptText)) { throw new IllegalArgumentException("Argument 'scriptText' must be specified"); } // clone script arguments and options - this serves two purposes // 1)makes sure everthing is serializable // 2)does a deep copy @SuppressWarnings("unchecked") Map<String, Object> scriptArgumentsClone = (Map<String, Object>) SerializerUtil.cloneObject(scriptArguments); this.scriptLanguage = scriptLanguage; this.scriptText = scriptText; this.scriptArguments = CollectionUtil.asReadOnlyMap(scriptArgumentsClone); }
/** * Public only for serialization; please use {@link ScriptContextBuilder}. * * @param scriptLanguage * The script language. Must not be null. * @param scriptText * The script text. Must not be null. * @param scriptArguments * The script arguments. May be null. */ public ScriptContext(String scriptLanguage, String scriptText, Map<String, Object> scriptArguments) { if (StringUtil.isBlank(scriptLanguage)) { throw new IllegalArgumentException("Argument 'scriptLanguage' must be specified"); } if (StringUtil.isBlank(scriptText)) { throw new IllegalArgumentException("Argument 'scriptText' must be specified"); } // clone script arguments and options - this serves two purposes // 1)makes sure everthing is serializable // 2)does a deep copy @SuppressWarnings("unchecked") Map<String, Object> scriptArgumentsClone = (Map<String, Object>) SerializerUtil.cloneObject(scriptArguments); this.scriptLanguage = scriptLanguage; this.scriptText = scriptText; this.scriptArguments = CollectionUtil.asReadOnlyMap(scriptArgumentsClone); }