Skip to content

Instantly share code, notes, and snippets.

@neilellis
Created October 6, 2014 14:05
Show Gist options
  • Select an option

  • Save neilellis/54028c78541e53d404d8 to your computer and use it in GitHub Desktop.

Select an option

Save neilellis/54028c78541e53d404d8 to your computer and use it in GitHub Desktop.
Piping in Dollar
package com.cazcade.dollar.pipe;
import com.cazcade.dollar.Script;
import com.cazcade.dollar.var;
import java.util.Date;
/**
* @author <a href="http://uk.linkedin.com/in/neilellis">Neil Ellis</a>
*/
public class FirstScript extends Script {
static {
$THIS = FirstScript.class;
}
{
var profile = $("name", "Neil")
.$("age", new Date().getYear() + 1900 - 1970)
.$("gender", "male")
.$("projects", $jsonArray("snapito", "dollar_vertx"))
.$("location",
$("city", "brighton")
.$("postcode", "bn1 6jj")
.$("number", 343)
);
profile.pipe(ExtractName.class).pipe(WelcomeMessage.class).out();
}
}
@neilellis
Copy link
Author

Yes, it is all valid Java, see :- https://github.com/cazcade/dollar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment