com.lexicalscope.fluentreflection.usecases
Class TestJoorExamples
java.lang.Object
com.lexicalscope.fluentreflection.usecases.TestJoorExamples
public class TestJoorExamples
- extends Object
Method Summary |
void |
joorArrayExample()
Employee[] employees = on(department).call("getEmployees").get();
for (Employee employee : employees) {
Street street = on(employee).call("getAddress").call("getStreet").get();
System.out.println(street);
} |
void |
joorStringExample()
String world = on("java.lang.String") // Like Class.forName()
.create("Hello World") // Call the most specific matching constructor
.call("substring", 6) // Call the most specific matching substring() method
.call("toString") // Call toString()
.get(); // Get the wrapped object, in this case a String |
void |
joorStringExampleWithMatchers()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TestJoorExamples
public TestJoorExamples()
joorStringExample
public void joorStringExample()
- String world = on("java.lang.String") // Like Class.forName()
.create("Hello World") // Call the most specific matching constructor
.call("substring", 6) // Call the most specific matching substring() method
.call("toString") // Call toString()
.get(); // Get the wrapped object, in this case a String
joorArrayExample
public void joorArrayExample()
- Employee[] employees = on(department).call("getEmployees").get();
for (Employee employee : employees) {
Street street = on(employee).call("getAddress").call("getStreet").get();
System.out.println(street);
}
joorStringExampleWithMatchers
public void joorStringExampleWithMatchers()
Copyright © 2011-2012 lexicalscope. All Rights Reserved.