> @@ -45,4 +46,13 @@ public boolean apply(final RESTLink link) {
>           }
>        };
>     }
> +   
> +   public static Predicate<RESTLink> isDisk() {
> +      return new Predicate<RESTLink>() {
> +         @Override
> +         public boolean apply(RESTLink link) {
> +            return link.getRel().matches("^" + REL_PREFIX + "[0-9]+$");

Would it make sense to avoid the cost of compiling the pattern every time by 
declaring a constant `IS_DISK_REL_PREFIX_PATTERN` 
[Pattern](http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html)
 and doing something like
```
public boolean apply(RESTLink link) {
  return IS_DISK_REL_PREFIX_PATTERN.matcher(link.getRel()).matches();
}
```

Also, just out of curiosity: how does REL_PREFIX following by numbers mean 
"it's a disk"? If the REL_PREFIX is unique to disks, should it perhaps be 
called DISK_REL_PREFIX or so instead?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/32/files#r7486206

Reply via email to