test_class.declarator: dictionary
test_class.modifier: private static
test_class.original_string: private static IDictionaryStructure dictionary;
test_class.type: IDictionaryStructure
test_class.var_name: dictionary
test_class.declarator: strictMessageFactory
test_class.modifier: private static
test_class.original_string: private static StrictMessageFactoryWrapper strictMessageFactory;
test_class.type: StrictMessageFactoryWrapper
test_class.var_name: strictMessageFactory
test_class.declarator: dictionaryName = "/messages/strictMessage.xml"
test_class.modifier: private static final
test_class.original_string: private static final String dictionaryName = "/messages/strictMessage.xml";
test_class.type: String
test_class.var_name: dictionaryName
test_class.declarator: namespace = "TestStrictmessage"
test_class.modifier: private final
test_class.original_string: private final String namespace = "TestStrictmessage";
test_class.type: String
test_class.var_name: namespace
test_class.declarator: expectedException = ExpectedException.none()
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public ExpectedException expectedException = ExpectedException.none();
test_class.type: ExpectedException
test_class.var_name: expectedException
test_class.file: BackEnd/Core/sailfish-core/src/test/java/com/exactpro/sf/common/impl/messages/TestStrictMessageWrapper.java
test_class.identifier: TestStrictMessageWrapper
test_case.body: @Test
      public void testNegativeCollectionInNoneCollectionField() {
          expectedException.expect(EPSCommonException.class);
          expectedException.expectMessage("Can't extract single value from collection cause it have more than 1 element");
          String msgName = "TestMessage";
          IMessage strictMsg = createStrictMessage(msgName);
          strictMsg.addField("integer", Arrays.asList(1, 2));
      }
test_case.class_method_signature: TestStrictMessageWrapper.testNegativeCollectionInNoneCollectionField()
test_case.full_signature: @Test public void testNegativeCollectionInNoneCollectionField()
test_case.identifier: testNegativeCollectionInNoneCollectionField
test_case.invocations: expect expectMessage createStrictMessage addField asList
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testNegativeCollectionInNoneCollectionField()
focal_class.declarator: messageStructure
focal_class.modifier: private final
focal_class.original_string: private final IMessageStructure messageStructure;
focal_class.type: IMessageStructure
focal_class.var_name: messageStructure
focal_class.declarator: message
focal_class.modifier: private final
focal_class.original_string: private final IMessage message;
focal_class.type: IMessage
focal_class.var_name: message
focal_class.file: BackEnd/Core/sailfish-core/src/main/java/com/exactpro/sf/common/impl/messages/StrictMessageWrapper.java
focal_class.identifier: StrictMessageWrapper
focal_class.interfaces: implements IMessage
focal_class.class_method_signature: StrictMessageWrapper.StrictMessageWrapper(IMessage message, IMessageStructure messageStructure)
focal_class.full_signature: public  StrictMessageWrapper(IMessage message, IMessageStructure messageStructure)
focal_class.identifier: StrictMessageWrapper
focal_class.modifiers: public
focal_class.parameters: (IMessage message, IMessageStructure messageStructure)
focal_class.signature:  StrictMessageWrapper(IMessage message, IMessageStructure messageStructure)
focal_class.class_method_signature: StrictMessageWrapper.castValueToCollection(Object value, Class<T> elementClass)
focal_class.full_signature: protected List<T> castValueToCollection(Object value, Class<T> elementClass)
focal_class.identifier: castValueToCollection
focal_class.modifiers: protected
focal_class.parameters: (Object value, Class<T> elementClass)
focal_class.return: List<T>
focal_class.signature: List<T> castValueToCollection(Object value, Class<T> elementClass)
focal_class.class_method_signature: StrictMessageWrapper.addField(String name, Object value)
focal_class.full_signature: @Override public void addField(String name, Object value)
focal_class.identifier: addField
focal_class.modifiers: @Override public
focal_class.parameters: (String name, Object value)
focal_class.return: void
focal_class.signature: void addField(String name, Object value)
focal_class.class_method_signature: StrictMessageWrapper.getName()
focal_class.full_signature: @Override public String getName()
focal_class.identifier: getName
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getName()
focal_class.class_method_signature: StrictMessageWrapper.getNamespace()
focal_class.full_signature: @Override public String getNamespace()
focal_class.identifier: getNamespace
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getNamespace()
focal_class.class_method_signature: StrictMessageWrapper.getMetaData()
focal_class.full_signature: @Override public MsgMetaData getMetaData()
focal_class.identifier: getMetaData
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: MsgMetaData
focal_class.signature: MsgMetaData getMetaData()
focal_class.class_method_signature: StrictMessageWrapper.removeField(String name)
focal_class.full_signature: @Override public Object removeField(String name)
focal_class.identifier: removeField
focal_class.modifiers: @Override public
focal_class.parameters: (String name)
focal_class.return: Object
focal_class.signature: Object removeField(String name)
focal_class.class_method_signature: StrictMessageWrapper.getField(String name)
focal_class.full_signature: @Override public T getField(String name)
focal_class.identifier: getField
focal_class.modifiers: @Override public
focal_class.parameters: (String name)
focal_class.return: T
focal_class.signature: T getField(String name)
focal_class.class_method_signature: StrictMessageWrapper.getFieldMetaData(String name)
focal_class.full_signature: @Override public FieldMetaData getFieldMetaData(String name)
focal_class.identifier: getFieldMetaData
focal_class.modifiers: @Override public
focal_class.parameters: (String name)
focal_class.return: FieldMetaData
focal_class.signature: FieldMetaData getFieldMetaData(String name)
focal_class.class_method_signature: StrictMessageWrapper.isFieldSet(String name)
focal_class.full_signature: @Override public boolean isFieldSet(String name)
focal_class.identifier: isFieldSet
focal_class.modifiers: @Override public
focal_class.parameters: (String name)
focal_class.return: boolean
focal_class.signature: boolean isFieldSet(String name)
focal_class.class_method_signature: StrictMessageWrapper.getFieldNames()
focal_class.full_signature: @Override public Set<String> getFieldNames()
focal_class.identifier: getFieldNames
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Set<String>
focal_class.signature: Set<String> getFieldNames()
focal_class.class_method_signature: StrictMessageWrapper.getFieldInfo(String name)
focal_class.full_signature: @Override public IFieldInfo getFieldInfo(String name)
focal_class.identifier: getFieldInfo
focal_class.modifiers: @Override public
focal_class.parameters: (String name)
focal_class.return: IFieldInfo
focal_class.signature: IFieldInfo getFieldInfo(String name)
focal_class.class_method_signature: StrictMessageWrapper.cloneMessage()
focal_class.full_signature: @Override public IMessage cloneMessage()
focal_class.identifier: cloneMessage
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: IMessage
focal_class.signature: IMessage cloneMessage()
focal_class.class_method_signature: StrictMessageWrapper.compare(IMessage message)
focal_class.full_signature: @Override public boolean compare(IMessage message)
focal_class.identifier: compare
focal_class.modifiers: @Override public
focal_class.parameters: (IMessage message)
focal_class.return: boolean
focal_class.signature: boolean compare(IMessage message)
focal_class.class_method_signature: StrictMessageWrapper.getFieldCount()
focal_class.full_signature: @Override public int getFieldCount()
focal_class.identifier: getFieldCount
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getFieldCount()
focal_class.class_method_signature: StrictMessageWrapper.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.class_method_signature: StrictMessageWrapper.requiredNotNull(Object value, IFieldStructure fieldStructure)
focal_class.full_signature: private Object requiredNotNull(Object value, IFieldStructure fieldStructure)
focal_class.identifier: requiredNotNull
focal_class.modifiers: private
focal_class.parameters: (Object value, IFieldStructure fieldStructure)
focal_class.return: Object
focal_class.signature: Object requiredNotNull(Object value, IFieldStructure fieldStructure)
focal_class.class_method_signature: StrictMessageWrapper.extractValueFromCollection(List<?> collection)
focal_class.full_signature: private Object extractValueFromCollection(List<?> collection)
focal_class.identifier: extractValueFromCollection
focal_class.modifiers: private
focal_class.parameters: (List<?> collection)
focal_class.return: Object
focal_class.signature: Object extractValueFromCollection(List<?> collection)
focal_class.class_method_signature: StrictMessageWrapper.checkElement(Object element, Class<T> elementClass)
focal_class.full_signature: @SuppressWarnings("unchecked") private T checkElement(Object element, Class<T> elementClass)
focal_class.identifier: checkElement
focal_class.modifiers: @SuppressWarnings("unchecked") private
focal_class.parameters: (Object element, Class<T> elementClass)
focal_class.return: T
focal_class.signature: T checkElement(Object element, Class<T> elementClass)
focal_method.body: @Override
      public void addField(String name, Object value) {
          IFieldStructure fieldStructure = messageStructure.getFields().get(name);
          if (fieldStructure == null) {
              message.addField(name, value);
              return;
          }
  
          if (value == null) {
              message.addField(name, requiredNotNull(value, fieldStructure));
              return;
          }
  
          if (fieldStructure.isComplex()) {
              if (fieldStructure.isCollection()) {
                  message.addField(name, castValueToCollection(value, StrictMessageWrapper.class));
              } else {
                  Object element = value;
                  if (value instanceof List<?>) {
                      element = extractValueFromCollection((List<?>)value);
                  }
                  message.addField(name, checkElement(requiredNotNull(element, fieldStructure), StrictMessageWrapper.class));
              }
          } else {
              try {
                  Class<?> clazz = getClass().getClassLoader().loadClass(fieldStructure.getJavaType().value());
  
                  if (fieldStructure.isCollection()) {
                      message.addField(name, castValueToCollection(value, clazz));
                  } else {
                      Object element = value;
                      if (value instanceof List<?>) {
                          element = extractValueFromCollection((List<?>)value);
                      }
                      message.addField(name, checkElement(requiredNotNull(element, fieldStructure), clazz));
                  }
              } catch (ClassNotFoundException e) {
                  throw new EPSCommonException("Unknown field type: " + fieldStructure.getJavaType().value(), e);
              }
          }
      }
focal_method.class_method_signature: StrictMessageWrapper.addField(String name, Object value)
focal_method.full_signature: @Override public void addField(String name, Object value)
focal_method.identifier: addField
focal_method.invocations: get getFields addField addField requiredNotNull isComplex isCollection addField castValueToCollection extractValueFromCollection addField checkElement requiredNotNull loadClass getClassLoader getClass value getJavaType isCollection addField castValueToCollection extractValueFromCollection addField checkElement requiredNotNull value getJavaType
focal_method.modifiers: @Override public
focal_method.parameters: (String name, Object value)
focal_method.return: void
focal_method.signature: void addField(String name, Object value)