This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| try { | |
| Settings settings = new Settings(); | |
| settings.usejavacp().tryToSetFromPropertyValue("true"); | |
| settings.stopAfter().tryToSetColon(Nil.$colon$colon("dce")); // same as "dce" :: Nil in scala | |
| settings.debug().tryToSetFromPropertyValue("true"); | |
| System.out.println("About to compile " + new String(sourceUnit.getContents())); | |
| PrintWriter out = new PrintWriter("output.txt"); | |
| IMain main = new IMain(settings, out); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git log --graph --pretty=\"format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset'\" --abbrev-commit --date=relative |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "data" : { | |
| "full-name": "M. Smith", | |
| "email" : "msmith@example.com" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "data" : [ | |
| {"name" : "full-name", "value" : "M. Smith", "prompt" : "Full Name"}, | |
| {"name" : "email", "value" : "msmith@example.org", "prompt" : "Email"} | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Data | |
| @Value | |
| @Builder(builderMethodName = "collectionJson") | |
| public class CollectionJson<T> { | |
| private String version; | |
| private String href; | |
| private List<Link> links; | |
| @Singular private List<Item<T>> items; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CollectionJson collectionJson = collectionJson() | |
| .version("1.0") | |
| .href(resource.getId().expand().getHref()) | |
| .links(value) | |
| .items(Collections.EMPTY_LIST) | |
| .build(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public abstract class AffordanceModelFactory implements Plugin<MediaType> { | |
| abstract public MediaType getMediaType(); | |
| abstract public List<AffordanceModel> findAffordanceModels(Affordance affordance, Object invocationValue); | |
| @Override | |
| public boolean supports(MediaType delimiter) { | |
| return delimiter != null && delimiter.equals(this.getMediaType()); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public interface Affordance { | |
| /** | |
| * HTTP method this affordance covers. For multiple methods, add multiple {@link Affordance}s. | |
| * | |
| * @return | |
| */ | |
| String getHttpMethod(); | |
| /** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @GetMapping("/employees/{id}") | |
| public Resource<Employee> findOne(@PathVariable String id) { | |
| // Start the affordance with the "self" link, i.e. this method. | |
| Link findOneLink = | |
| linkTo(methodOn(EmployeeController.class).findOne(id)).withSelfRel(); | |
| // Define final link as means to find entire collection. | |
| Link employeesLink = linkTo(methodOn(EmployeeController.class).all()).withRel("employees"); |
NewerOlder