/** Returns the value corresponding to this entry, as a String. */ public Object getValue() { Object actualValue = super.getValue(); String stringValue = FeatureWrapper.valueToString(actualValue); return stringValue; } }
/** * Compares the specified object with this entry for equality. * * @param object The object to compare with this entry for equality. */ @Override public boolean equals(final Object object) { if (object instanceof Map.Entry) { final Map.Entry that = (Map.Entry) object; return Utilities.equals(this.getKey(), that.getKey()) && Utilities.equals(this.getValue(), that.getValue()); } return false; }
/** * Compares the specified object with this entry for equality. * * @param object The object to compare with this entry for equality. */ @Override public boolean equals(final Object object) { if (object instanceof Map.Entry) { final Map.Entry that = (Map.Entry) object; return Utilities.equals(this.getKey(), that.getKey()) && Utilities.equals(this.getValue(), that.getValue()); } return false; }
/** * Compares the specified object with this entry for equality. */ public boolean equals(final Object object) { if (object instanceof Map.Entry) { final Map.Entry that = (Map.Entry) object; return Utilities.equals(this.getKey(), that.getKey()) && Utilities.equals(this.getValue(), that.getValue()); } return false; }
String covName = mapEntry.getValue();
String covName = mapEntry.getValue();
@Test public void testDecode03() { String qualifiedName = "s1___s2"; List<MapEntry<String, String>> decode = NCNameResourceCodec.decode(qualifiedName); assertEquals(2, decode.size()); assertEquals("s1_", decode.get(0).getKey()); assertEquals("s2", decode.get(0).getValue()); assertEquals("s1", decode.get(1).getKey()); assertEquals("_s2", decode.get(1).getValue()); }
@Test public void testDecode02() { String qualifiedName = "s1__s2__s3"; List<MapEntry<String, String>> decode = NCNameResourceCodec.decode(qualifiedName); assertEquals(2, decode.size()); assertEquals("s1__s2", decode.get(0).getKey()); assertEquals("s3", decode.get(0).getValue()); assertEquals("s1", decode.get(1).getKey()); assertEquals("s2__s3", decode.get(1).getValue()); }
@Test public void testDecode01() { String qualifiedName = "ws__name"; List<MapEntry<String, String>> decode = NCNameResourceCodec.decode(qualifiedName); assertEquals(1, decode.size()); assertEquals("ws", decode.get(0).getKey()); assertEquals("name", decode.get(0).getValue()); }
@Test // (expected=IllegalArgumentException.class) public void testDecodeBad() { String qualifiedName = "bad_qualified_name"; List<MapEntry<String, String>> decode = NCNameResourceCodec.decode(qualifiedName); assertEquals(1, decode.size()); assertNull(decode.get(0).getKey()); assertEquals("bad_qualified_name", decode.get(0).getValue()); } }