public Links commandwithvalue() { return new LinksBuilder(module). command( "commandwithvalue" ). addLink( "Command ABC","right" ). addLink( "Command XYZ", "wrong" ).newLinks(); }
@Override public Links index() { return new LinksBuilder(module) .addLink( "Page1", "page1") .addLink( "Page2", "page2") .addLink( "Page3", "page3") .newLinks(); } }
public T addLink( String description, String id ) { try { linkBuilder.prototype().text().set( description ); linkBuilder.prototype().id().set( id ); if( command != null ) { linkBuilder.prototype().href().set( command + "?entity=" + id ); } else { linkBuilder.prototype() .href() .set( ( path == null ? "" : path + "/" ) + URLEncoder.encode( id, "UTF-8" ) + "/" ); } linkBuilder.prototype().rel().set( rel ); linkBuilder.prototype().classes().set( classes ); addLink( linkBuilder.newInstance() ); return (T) this; } catch( UnsupportedEncodingException e ) { e.printStackTrace(); return (T) this; } }
public T addLink( String description, String id, String rel, String href, String classes ) { linkBuilder.prototype().text().set( description ); linkBuilder.prototype().id().set( id ); linkBuilder.prototype().rel().set( rel ); linkBuilder.prototype().href().set( href ); linkBuilder.prototype().classes().set( classes ); addLink( linkBuilder.newInstance() ); return (T) this; }