Skip to content

Instantly share code, notes, and snippets.

@masahitojp
Created December 16, 2011 08:03
Show Gist options
  • Save masahitojp/1485039 to your computer and use it in GitHub Desktop.
Save masahitojp/1485039 to your computer and use it in GitHub Desktop.
play! でのPattern Matchの使い方
import static play.libs.F.Matcher.*;
public class matcher_Test extends UnitTest {
@Test
public void test_matcher_object() {
String value = "Foobar";
for (String s : String.and(StartsWith("Foo")).match(value)) {
value = s.toUpperCase();
}
assertThat(value, is("FOOBAR"));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment