@Test public void testToTermName$valid() throws Exception { for(Entry<String, String> entry:termMappings.entrySet()) { assertThat(entry.getKey()+"-->"+entry.getValue(),TermUtils.toTermName(entry.getKey()),equalTo(entry.getValue())); } }
static String toTermName(String string) { if(!isValidEntityName(string)) { throw new IllegalArgumentException("Object '"+string+"' is not a valid entity name"); } TermUtils.State state=new Start(); TermUtils.Context context=new Context(); for(int i=0;i<string.length();i++) { state=state.accept(i,string.charAt(i),context); } return context.complete(); }
TermUtils { static String toTermName(String string) { if(!isValidEntityName(string)) { throw new IllegalArgumentException("Object '"+string+"' is not a valid entity name"); } TermUtils.State state=new Start(); TermUtils.Context context=new Context(); for(int i=0;i<string.length();i++) { state=state.accept(i,string.charAt(i),context); } return context.complete(); } }
TermUtils { static String toTermName(String string) { if(!isValidEntityName(string)) { throw new IllegalArgumentException("Object '"+string+"' is not a valid entity name"); } TermUtils.State state=new Start(); TermUtils.Context context=new Context(); for(int i=0;i<string.length();i++) { state=state.accept(i,string.charAt(i),context); } return context.complete(); } private  TermUtils(); }
TermUtils { static String toTermName(String string) { if(!isValidEntityName(string)) { throw new IllegalArgumentException("Object '"+string+"' is not a valid entity name"); } TermUtils.State state=new Start(); TermUtils.Context context=new Context(); for(int i=0;i<string.length();i++) { state=state.accept(i,string.charAt(i),context); } return context.complete(); } private  TermUtils();  }
TermUtils { static String toTermName(String string) { if(!isValidEntityName(string)) { throw new IllegalArgumentException("Object '"+string+"' is not a valid entity name"); } TermUtils.State state=new Start(); TermUtils.Context context=new Context(); for(int i=0;i<string.length();i++) { state=state.accept(i,string.charAt(i),context); } return context.complete(); } private  TermUtils();   }