Last active
September 28, 2015 22:19
-
-
Save jarrodhroberson/516b0cf13b0f781ed305 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.vertigrated.rtti; | |
import com.google.common.collect.ImmutableSortedMap; | |
import org.junit.Test; | |
import java.io.Serializable; | |
public class MapAsJavaBeanProxyTest | |
{ | |
@Test | |
public void testMapAsJavaBeanProxy() | |
{ | |
final ImmutableSortedMap<String, Object> ism = ImmutableSortedMap.of("getString", "This is a String", "getInteger", Integer.MAX_VALUE, "getBoolean", true); | |
final TestInterface t = MapBackedJavaBeanProxy.as(TestInterface.class).from(ism); | |
System.out.println("t.getString() = " + t.getString()); | |
System.out.println("t.getInteger() = " + t.getInteger()); | |
System.out.println("t.getBoolean() = " + t.getBoolean()); | |
System.out.println("t.toString() = " + t.toString()); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.vertigrated.rtti; | |
interface TestInterface | |
{ | |
public String getString(); | |
public Integer getInteger(); | |
public Boolean getBoolean(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment