Java SE

Lambda Recipe for attribute validation of Collection of POJOs

So here is a recipe you can use to validate a POJO attribute for some value. In my case I will show you how to check if attributes were set to null. But you can expand on the example as an exercise for yourself.

So here is the template method for a single object and a collection of objects:

Regex Lookahead and Lookbehind : Match Prefix and Suffix string but only accepting anything in between

Reg ex, lookahead, lookbehind

So there is a little known construct in regex of lookahead and lookbehind, that java regex also supports atleast upwards from java 5. This is exactly what you need if the desired match lives between a known prefix and suffix String. Or depending on if you have a prefix you can use the lookbehind construct and if you have a suffix only, you can use the lookahead construct.

So the lookbehind is represented by (?<=X) and lookahead is represented by (?=X).

Java keytool command references

Here are some commands I just found lying around that I once used when working with SSL enablement for a product. I think they should be useful examples for some one wanting to work with the keytool. So decided to just put these out there simply.

First a quick quotation from Oracle Java what the keyool is and does from their doc page here. ( I have linked to java se 6 docu as I believe that is what I actually used for the example commands ) :

Subscribe to RSS - Java SE