Example usage for org.apache.commons.collections4 BidiMap get

List of usage examples for org.apache.commons.collections4 BidiMap get

Introduction

In this page you can find the example usage for org.apache.commons.collections4 BidiMap get.

Prototype

V get(Object key);

Source Link

Document

Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key.

Usage

From source file:de.decoit.simu.cbor.xml.dictionary.DictionaryEnumValueAttributeTest.java

@Test
public void testAddEnumValue() {
    DictionaryEnumValueAttribute instance = new DictionaryEnumValueAttribute(xmlName, cborName);
    instance.addEnumValue(enumXmlName1, enumCborName1);

    BidiMap<String, DataItem> result = instance.getUnmodifiableEnumValues();
    assertTrue(result.containsKey(enumXmlName1));
    assertTrue(result.containsValue(enumCborName1));
    assertEquals(enumCborName1, result.get(enumXmlName1));
}

From source file:de.decoit.simu.cbor.xml.dictionary.DictionaryEnumValueElementTest.java

@Test
public void testAddEnumValue() {
    DictionaryEnumValueElement instance = new DictionaryEnumValueElement(xmlName, cborName);
    instance.addEnumValue(enumXmlName1, enumCborName1);

    BidiMap<String, DataItem> result = instance.getUnmodifiableEnumValues();
    assertTrue(result.containsKey(enumXmlName1));
    assertTrue(result.containsValue(enumCborName1));
    assertEquals(enumCborName1, result.get(enumXmlName1));
}

From source file:de.decoit.simu.cbor.xml.dictionary.DictionaryComplexElementTest.java

@Test
public void testAddNestedElement_DictionarySimpleElement() {
    DictionarySimpleElement dse = new DictionarySimpleElement(nestedXmlName, nestedCborName);

    DictionaryComplexElement instance = new DictionaryComplexElement(xmlName, cborName);
    instance.addNestedElement(dse);//from   w w  w .  j a v a2 s  .  c  om

    BidiMap<String, DictionarySimpleElement> result = instance.getUnmodifiableNestedElements();
    assertTrue(result.containsKey(nestedXmlName));
    assertTrue(result.containsValue(dse));
    assertEquals(dse, result.get(nestedXmlName));
}

From source file:de.decoit.simu.cbor.xml.dictionary.DictionaryComplexElementTest.java

@Test
public void testAddNestedElement_DictionaryComplexElement() {
    DictionaryComplexElement dce = new DictionaryComplexElement(nestedXmlName, nestedCborName);

    DictionaryComplexElement instance = new DictionaryComplexElement(xmlName, cborName);
    instance.addNestedElement(dce);//from   w  w w  .j a  v  a2s  . co m

    BidiMap<String, DictionarySimpleElement> result = instance.getUnmodifiableNestedElements();
    assertTrue(result.containsKey(nestedXmlName));
    assertTrue(result.containsValue(dce));
    assertEquals(dce, result.get(nestedXmlName));
}

From source file:de.decoit.simu.cbor.xml.dictionary.DictionaryComplexElementTest.java

@Test
public void testAddNestedElement_DictionaryEnumValueElement() {
    DictionaryEnumValueElement deve = new DictionaryEnumValueElement(nestedXmlName, nestedCborName);

    DictionaryComplexElement instance = new DictionaryComplexElement(xmlName, cborName);
    instance.addNestedElement(deve);/*from   w ww.  ja v  a 2  s.c o  m*/

    BidiMap<String, DictionarySimpleElement> result = instance.getUnmodifiableNestedElements();
    assertTrue(result.containsKey(nestedXmlName));
    assertTrue(result.containsValue(deve));
    assertEquals(deve, result.get(nestedXmlName));
}

From source file:de.decoit.simu.cbor.xml.dictionary.DictionaryNamespaceTest.java

@Test
public void testAddElement_DictionarySimpleElement() {
    DictionarySimpleElement dse = new DictionarySimpleElement(elementXmlName, elementCborName);

    DictionaryNamespace instance = new DictionaryNamespace(xmlName, cborName);
    instance.addElement(dse);//from  w  w  w  . ja  v a  2  s .c om

    BidiMap<String, DictionarySimpleElement> result = instance.getUnmodifiableElements();
    assertTrue(result.containsKey(elementXmlName));
    assertTrue(result.containsValue(dse));
    assertEquals(dse, result.get(elementXmlName));
}

From source file:de.decoit.simu.cbor.xml.dictionary.DictionaryNamespaceTest.java

@Test
public void testAddElement_DictionaryComplexElement() {
    DictionaryComplexElement dce = new DictionaryComplexElement(elementXmlName, elementCborName);

    DictionaryNamespace instance = new DictionaryNamespace(xmlName, cborName);
    instance.addElement(dce);/* www . j a  va2  s.  c  o m*/

    BidiMap<String, DictionarySimpleElement> result = instance.getUnmodifiableElements();
    assertTrue(result.containsKey(elementXmlName));
    assertTrue(result.containsValue(dce));
    assertEquals(dce, result.get(elementXmlName));
}

From source file:de.decoit.simu.cbor.xml.dictionary.DictionaryNamespaceTest.java

@Test
public void testAddElement_DictionaryEnumValueElement() {
    DictionaryEnumValueElement deve = new DictionaryEnumValueElement(elementXmlName, elementCborName);

    DictionaryNamespace instance = new DictionaryNamespace(xmlName, cborName);
    instance.addElement(deve);//from  w  w w  .  jav  a 2  s  .co  m

    BidiMap<String, DictionarySimpleElement> result = instance.getUnmodifiableElements();
    assertTrue(result.containsKey(elementXmlName));
    assertTrue(result.containsValue(deve));
    assertEquals(deve, result.get(elementXmlName));
}

From source file:de.decoit.simu.cbor.xml.dictionary.DictionarySimpleElementTest.java

@Test
public void testAddAttribute_DictionarySimpleAttribute() {
    DictionarySimpleAttribute dsa = new DictionarySimpleAttribute(attrXmlName, attrCborName);

    DictionarySimpleElement instance = new DictionarySimpleElement(xmlName, cborName);
    instance.addAttribute(dsa);/*from w w w . ja v  a2s.  c om*/

    BidiMap<String, DictionarySimpleAttribute> result = instance.getUnmodifiableAttributes();
    assertTrue(result.containsKey(attrXmlName));
    assertTrue(result.containsValue(dsa));
    assertEquals(dsa, result.get(attrXmlName));
}

From source file:de.decoit.simu.cbor.xml.dictionary.DictionarySimpleElementTest.java

@Test
public void testAddAttribute_DictionaryEnumValueAttribute() {
    DictionaryEnumValueAttribute deva = new DictionaryEnumValueAttribute(attrXmlName, attrCborName);

    DictionarySimpleElement instance = new DictionarySimpleElement(xmlName, cborName);
    instance.addAttribute(deva);/*from  w w  w  . jav a 2  s .  com*/

    BidiMap<String, DictionarySimpleAttribute> result = instance.getUnmodifiableAttributes();
    assertTrue(result.containsKey(attrXmlName));
    assertTrue(result.containsValue(deva));
    assertEquals(deva, result.get(attrXmlName));
}